Skip to content

Commit dec3a82

Browse files
committed
added patternbuilder module logs
1 parent 5257eee commit dec3a82

File tree

2 files changed

+53
-29
lines changed

2 files changed

+53
-29
lines changed

docs/pattern_builder_importer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It converts an library of JSON Schemas into Drupal paragraph bundles, and the JS
1313

1414
1. With a library of patterns created in Pattern Builder, we need a method for creating each Drupal admin interface that allow users to enter the data needed for each template.
1515

16-
1. As a content admin, you may want to create a customizable content type(s) which include entity references to smaller content patterns, such as field collection bundles. These bundles will be built to match the defined components from the Styleguide. This would expose the ability to both create content and control the ordering, layout, and design from within the node editing interface, and would be fully revisionable. Additionally, editors would be able reference & include existing view blocks within the field groups. Editors could then apply data attributes such as layout and theme to these view blocks or field collections.
16+
1. As a content admin, you may want to create a customizable content type(s) which include entity references to smaller content patterns, such as field collection bundles. These bundles will be built to match the defined components from the Style guide. This would expose the ability to both create content and control the ordering, layout, and design from within the node editing interface, and would be fully revisionable. Additionally, editors would be able reference & include existing view blocks within the field groups. Editors could then apply data attributes such as layout and theme to these view blocks or field collections.
1717

1818

1919
### Where
@@ -48,11 +48,11 @@ It converts an library of JSON Schemas into Drupal paragraph bundles, and the JS
4848

4949
1. Drush Commands
5050
1. Imports patterns from defined library
51-
- drush pbi  : Import all schemas.
52-
- drush pbi --all  :  Force the import of all schemas even if specific schemas are defined.
53-
- drush pbi band card :  Import only the "band" and "card" schemas.
54-
- drush pbi --type=layout  : Import only the schemas for the "layout" pattern type.
55-
- drush pbi -image_box
51+
- drush pbi : Import all schemas.
52+
- drush pbi --all : Force the import of all schemas even if specific schemas are defined.
53+
- drush pbi band card : Import only the "band" and "card" schemas.
54+
- drush pbi --type=layout : Import only the schemas for the "layout" pattern type.
55+
- drush pbi image_box
5656

5757
1. Remove imported patterns from Drupal
5858
- drush pbi-remove  : Nothing is removed. This safeguards against accidental commands.
@@ -361,15 +361,15 @@ This message is logged if the referenced property's schema is not creatable and
361361

362362
The allowed schemas references a schema that is not imported based on the pattern's status. The "inactive" status is provided by the patternbuilder module.
363363

364-
In Drupal, this refers to the pargraphs field's allowed bundles (schemas) which must be available on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
364+
In Drupal, this refers to the paragraphs field's allowed bundles (schemas) which must be available on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
365365

366366
- - -
367367

368368
**WARNING: 'The paragraphs field @field_name references a schema that is not creatable due to the status "deprecated", schema: schema_old.json'**
369369

370370
The allowed schemas references a schema that is not creatable based on the pattern's status. The "inactive" and "deprecated" statuses are provided by the patternbuilder module.
371371

372-
In Drupal, this refers to the pargraphs field's allowed bundles (schemas) which must be allowed to be created on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
372+
In Drupal, this refers to the paragraphs field's allowed bundles (schemas) which must be allowed to be created on the site. This is a WARNING since this only reduces the allowed bundle options and does not block the import.
373373

374374
- - -
375375

docs/pattern_builder_module.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title: Pattern Builder Drupal Module
99

1010
The Pattern Builder Module empowers your team to prototype in a static pattern library and then import the designs and content data model into Drupal with a single drush command.
1111

12-
Need to update your design? No problem! Just update and QA the code in your pattern library and import those changes in seconds.
12+
Need to update your design? No problem! Just update and QA the code in your pattern library and import those changes to Drupal in seconds.
1313

1414

1515
### Why
@@ -27,28 +27,17 @@ Need to update your design? No problem! Just update and QA the code in your patt
2727

2828
### How
2929

30-
Good question! It could be:
30+
The Pattern Builder module contains a composer.json to build the library dependencies.
31+
Below are some options to integrate the patternbuilder module into a project.
3132

32-
1. Composer Module
33-
- Add composer dependency
34-
- Symlink assets to web/app root (or use custom install location)
35-
- Create pb_config.yml
36-
1. Includes paths to schemas/templates/data
37-
2. Includes paths to js/css to add to preview
38-
39-
1. Git clone
40-
- Clone repo to root (at least at/above theme)
41-
- Repo includes
42-
1. Index.php (index just pulls from app folder)
43-
2. pb_config.yml
44-
3. App_folder
45-
46-
1. Grunt Project
47-
- Clone grunt repo. NPM install, Bower Install, Composer install
48-
- Use built in yeoman to create templates/schemas
49-
- Add sass and sample data to component/layout folders
50-
- Run grunt commands to compile, spin up local php server, lint etc
33+
1. Composer Manager Module: [https://www.drupal.org/project/composer_manager](https://www.drupal.org/project/composer_manager)
34+
- Install the composer_manager module.
35+
- Download and install the patternbuilder module: `drush en -y patternbuilder`
36+
- See the Composer Manager's documentation for more commands.
5137

38+
1. Git clone / Drush Make file
39+
- Clone repo to the site's modules directory (Example: "sites/all/modules").
40+
- Run `composer install` within the patternbuilder module's directory.
5241

5342
### JSON Schema Support
5443

@@ -57,6 +46,41 @@ Good question! It could be:
5746
If the schema defines a "uniqueId" property, then the property value is set to the paragraph entity's item id during the rendering process.
5847

5948

49+
### Troubleshooting
50+
51+
All errors and warnings are logged via the Drupal watchdog() function.
52+
One of the following modules should be enabled on the site:
53+
54+
- Database logging (dblog):
55+
- Drupal configuration: "/admin/config/development/logging"
56+
- View logs: "/admin/reports/dblog", filter by type = "patternbuilder"
57+
- Syslog (syslog):
58+
- Drupal configuration: "/admin/config/development/logging"
59+
- View logs: Logs are available in the server log files, search for logs with "patternbuilder". Actual location depends on the server's config for syslog.
60+
61+
62+
#### Log Messages
63+
64+
**WARNING: 'Duplicate schemas found for "my_schema" at "file:///path/to/schemas-alternative/my_schema.json". The first schema registered will be used until this conflict has been resolved. Active schema: "file:///path/to/schemas/my_schema.json"'**
65+
66+
The Pattern Builder module allows multiple schema directories to be defined at "admin/config/content/patternbuilder". This message is logged when there is a schema file with the same name in multiple directories.
67+
68+
- Check that the schema directories are configured correctly at "admin/config/content/patternbuilder".
69+
- Verify the schema files in the directories.
70+
71+
- - -
72+
73+
**ERROR: 'An error occurred while rendering the "pbi_my_schema" paragraph item (id:1, revision:22) on node (id:234, revision:6788): Unable to find template ".twig" (looked into: /var/www/html/path/to/schemas, /var/www/html/path/to/schemas-alternative) in "my_band.twig" at line 61.**
74+
75+
The error log "An error occurred while rendering ..." occurs during rendering of the field formatter typically on the node page. This error is logged for any error occurring in the Pattern Library rendering of the schema and TWIG template.
76+
77+
This is a silent error so that it does not stop the rendering of the rest of patterns and the Drupal page. The failed pattern will not be displayed on the page.
78+
79+
A common error is displayed above. This is an error when a TWIG template includes another template without specifying a file name.
80+
81+
- - -
82+
83+
6084
### TODO
6185

6286
Install Options: (NEEDS CLEANUP)

0 commit comments

Comments
 (0)