-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP errors #17
Comments
Hi Chris, What Pattern Lab instance are you using the module with? Is it something publicly available that I could pull down and try myself, or is it a private repo? That said, the first error looks similar to something that I saw while testing with the Emulsify theme in #1 For emulsify the error is being caused by /components/_patterns/01-atoms/09-menu/tab/tab.twig
I think the patterns page passes the if attributes check, but then the pattern doesn't have preview data for the link array, causing the error. If this is the cause in your case, I think it should at least be possible to add the necessary data to the pattern definition file so that the link can at least be rendered. For debugging purposes it is possible to ignore a pattern by adding the following to the pattern definition file in pattern lab (more info in the docs here):
So if we think we have it narrowed down to a particular pattern we can ignore it and see if the pattern library page will load without it. As for the notice, I can dupe that one locally so I should be able to clean it up. Thanks for submitting this issue - the more issues we can identify and fix by running this with a variety of pattern lab instances the more useful it should end up being for folks. |
Issues/17: resolving php errors and warnings
I was able to duplicate the URI error with a pattern that uses:
But doesn't provide data for the link array. If I add the following data in the pattern definition file it resolves the error:
In PR #19 I also cleaned up the warnings you mentioned. That has been merged into the latest dev version of the module. |
I've run into the same issue as well (using the latest dev of this module) using Emulsify when I visit the |
Oh I see, the error might be caused by |
Hi @danny-englander - you're correct that this is being caused by /components/_patterns/01-atoms/09-menu/tab/tab.twig in Emulisfy. You should be able to work around it by adding one of the following in /components/_patterns/01-atoms/09-menu/tab/tab.yml
This example data should be enough for UI Patterns to be able to render a preview of the pattern. Alternatively, you could add
Which will cause UI Patterns Pattern lab to ignore the pattern. Testing this module with Emulsify seems like a common starting point for folks, so I'm going to try to do a little more to improve this. More documentation might help, and I also wonder if I could submit a PR against Emulsify that would maintain Emulsify functionality but prevent this hiccup. There is also a UI Patterns PR around handling missing patterns more gracefully. I'm going to take a closer look at that issue - I wonder if that or a similar fix could help improve this situation as well. |
@backlineint yes, I see now, either of those methods work and I can now see my patterns. Thank you! |
Hi, I'm having some problems using this module. Visiting /patterns results in an error page beginning:
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: The URI '' is invalid. You must use a valid URI scheme. in <em class="placeholder">Drupal\Core\Url::fromUri()</em> (line <em class="placeholder">281</em> of <em class="placeholder">core/lib/Drupal/Core/Url.php</em>). <pre class="backtrace">Drupal\Core\Template\TwigExtension->getLink(NULL, NULL, Array) (Line: 64)
Visiting other content pages results in the following notices:
Notice: Only variables should be passed by reference in Drupal\ui_patterns_pattern_lab\Plugin\Deriver\PatternLabDeriver->templateExists() (line 147 of modules/contrib/ui_patterns_pattern_lab/src/Plugin/Deriver/PatternLabDeriver.php).
I'm using Acquia Dev Desktop with php v 7.0.14.
The text was updated successfully, but these errors were encountered: