Fix Pattern Lab Twig Lineages When Using D8-friendly Twig Paths (Part 1 of 2)#1
Merged
EvanLovely merged 3 commits intodevfrom May 9, 2017
Merged
Conversation
…nearly as easy as copying over from the config.yml file...
…sing D8 friendly Twig paths
EvanLovely
approved these changes
May 9, 2017
EvanLovely
left a comment
There was a problem hiding this comment.
Looks good to me; especially since it wasn't working before anyway :P What's part 2? Could you open up an issue as a placeholder please? Thanks for getting this in!
Collaborator
Author
|
@EvanLovely - can definitely throw in a placeholder issue into our fork of PL Core I THINK Part 2 is almost ready for a PR -- this week's just been crazy busy so I haven't gotten to it yet (BUT SOON!) =P |
sghoweri
pushed a commit
to drupal-pattern-lab/patternlab-php-core
that referenced
this pull request
May 10, 2017
… comments to explain my PHP chicken scratch. Addresses existing open issue #3 and corresponds with the 2nd half of work mentioned in drupal-pattern-lab/patternengine-php-twig#1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First half of the fix required in order to get pattern lineages working in Pattern Lab again when using Twig templates and/or use virtually any character in your template that the original regex can't account for.
Note: this shouldn't appear to change any current lineage behavior just yet if just testing this one part. Once the other LineageHelper.php fix is in place this should be fully up and running.
Adds and expands Pattern Lab lineage support (on the regex side) when using Twig templates:
withsyntax including commas (previously failed)Testing notes:
PL still compiles properly without any errors if using the updated regex logic but still using the originl unpatched LineageHelper.php file.
Same is also true (no errors) if using the updated LineageHelper.php logic but the _config.yml is using the old Twig regex
Using the updated regex + updated LineageHelper.php logic also compiles successfully without any errors, however it also appears to fully fix the broken Pattern Lab lineage functionality that's been broken for quite some time, at least based on out in the wild
Furthermore, tested requiring this json-friendly version in via composer which properly adds the yaml-friendly / converted version to config.yml:
ex. config.yml should look something like this when updated.