Closed (fixed)
Project:
Search configuration
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2016 at 06:36 UTC
Updated:
15 Aug 2016 at 06:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joyceg commentedComment #3
joyceg commentedComment #4
joyceg commentedComment #5
naveenvalechaThis needs reroll
Comment #6
joyceg commentedComment #7
joyceg commentedComment #8
naveenvalechaHere's the patch that will also resolve the template not found issue on the admin/config/search/pages page
Comment #9
naveenvalechaComment #10
naveenvalechaFixing coding standards in twig template.
Comment #11
naveenvalechaNow the explanation of the changes :
Coding standard fixes.
we don't need to explictly pass the template name. btw if you'll not pass the template name then it is same as the array key being returned. like in this case the twig loader will search for template templates/search-config-admin-label-form.html.twig
Now why the name is search-config-admin-label-form.html.twig ?
Because the key is "search_config_admin_label_form" so the template name converted to .html.twig by converting _ with -
Fixed coding standards in twig template. From tab to two spaces.
Comment #12
naveenvalechaNow Review of #10 :
have you tested the patch ? Nothing showing on the path admin/config/search/pages ?
Please test and update the patch accordingly.
Also make sure that you have coding standards configured
Comment #13
smazI've applied this patch against the latest dev version of search_config, against drupal 8.2.x dev.
It's not working for me I'm afraid, I get WSOD errors from twig issues.
I'm currently trying to work through them & update the patch, if I don't get it finished in time I'll post my progress + updates on the errors I'm having.
Comment #14
smazI'm still struggling to get the patch in #10 to work, so here's my notes - I'm not quite sure what the form is supposed to be displaying, so I'm not sure what I need to fix.
1) "Twig_Error_Syntax: An array element must be followed by a comma. Unexpected token "punctuation" of value ":" ("punctuation" expected with value ",") in "modules/contrib/search_config/templates/search-config-admin-label-form.html.twig" at line 3. in Twig_TokenStream->expect() (line 87 of /var/www/site/docroot/vendor/twig/twig/lib/Twig/TokenStream.php).
In Twig, arrays can't have named keys - instead, it is what they call a 'hash':
https://mijingo.com/blog/key-value-arrays-in-twig
So instead of:
{% for form_key, form_name in ['basic':'Basic'|t, 'advanced':'Advanced'|t] %}It should be:
{% for form_key, form_name in {'basic':'Basic'|t, 'advanced':'Advanced'|t} %}2) Line 12 is just plain text, it should be wrapped in {% %}
set has_title_display = falseShould be:
{% set has_title_display = false %}3)
I believe the twig syntax is:
if (variable) is not nullSo I've managed to get this line to work (or at least not provide fatal errors) by changing it to:
That's as far as I've got - after fixing the above issues, the page loads however the "LABELS AND STRING OVERRIDES" table is blank on each row. I'm not sure what should be displayed, so I can't go any further.
Comment #15
joyceg commentedThanks smaz for your suggestions.
Attaching the improved patch here. It is resolving the white screen issue.
Comment #16
joyceg commentedComment #17
joyceg commentedPlease ignore #15. This is the required patch here.
Comment #18
smazI've just tried the patch in #17:
It fixes the white screen issue, but I'm still not getting any content in the 'LABELS AND STRING OVERRIDES' section. See the attached screenshot.
What should be displayed here? If you could provide a screenshot or description, I can try to work out why that is.
I could do with this module on a project at the moment, so happy to try & help where I can.
Cheers :)
Comment #19
joyceg commentedIt has to be of the form like:
Comment #20
naveenvalechaback to N/W for #18, Assigning to joy to test it and check what's needful for it.
Comment #21
joyceg commentedComment #22
naveenvalechaInterdiff please
Comment #23
naveenvalechaReviewed the whole patch again.looks good.
One problem that I found is in the ttached screenshot. Please file a seperate issue for the same.
Comment #25
naveenvalechaThanks! Committed and pushed to 8.x-1.x