I am building a number of node template variants based on a list field on the node where the content admin can choose which layout they would like their page to have.
I've chosen this field under "selection rules" for each variant and chosen the appropriate value for the variant. After changing the value for this field, if I click the configure settings gear for the item, the values are presented with the default value rather than the value I selected for the active variant. If I change the value again and click "update and save", when I return to the "selection rules" tab and click on the configure settings gear, yet again the default value is selected instead of the value I had chosen and saved.
The result is that changing the value for this field on the node does not result in the appropriate page variant being applied to that node page.
Oddly enough, the export code outputs the correct value for this setting:
$handler->conf = array(
'title' => 'T3 Interior Template Three',
'no_blocks' => 0,
'pipeline' => 'standard',
'css_id' => 'tfa-template-three',
'css' => '',
'contexts' => array(),
'relationships' => array(),
'access' => array(
'plugins' => array(
0 => array(
//Layout Setting
'name' => 'entity_field_value:node:page:field_page_layout',
'settings' => array(
'field_page_layout' => array(
'und' => array(
0 => array(
'value' => 'three',
),
),
),
'field_page_layout_value' => 'three',
),
'context' => 'argument_entity_id:node_1',
'not' => FALSE,
),
1 => array(
'name' => 'node_type',
'settings' => array(
'type' => array(
'page' => 'page',
),
),
'context' => 'argument_entity_id:node_1',
'not' => FALSE,
),
),
'logic' => 'and',
),
);
I've tested this on a clean install of Drupal and was able to recreate the issue.
Steps to reproduce:
- Add a list (text) field with radios widget to any node type
- provide 2-3 options for that field
- Enable the Node Template page in Page Manager
- Create a new variant
- Under selection rules, choose the new field you created from the drop-down list. configure it to use any one value.
- choose the "all criteria must pass option"
- Save the variant
- Create a test node with the same value for the option field as your page variant and notice that the panel is not applied to that node.
- Edit the variant. click the "configure" gear next to you field selection rule and notice that the default option is selected instead of the option previously specified.
Let me know if I can provide any more information. The entirety of the variant export code is attached.
Comment | File | Size | Author |
---|---|---|---|
#2 | ctools-field_access_plugin_ignoring_selected_value-1601062-1.patch | 1.12 KB | Tresler |
field_access_bug_example_page.txt | 6.09 KB | sheena_d |
Comments
Comment #1
Tresler CreditAttribution: Tresler commentedThis took a bit of figuring out... The bracketing is incorrect in entity_field_value.inc 102:113
Should be:
Patch coming in shortly.
Comment #2
Tresler CreditAttribution: Tresler commentedOk - patch attached.
Comment #3
andypostThanx a lot, this really useful and major because could cause a data loss because select-list always resets
patch applies cleanly and fixes a edit form.
Related issues #1558708: Ctools bug in term rule ('tid equals') in Panels Selection rules #1435426: Notices thrown when using visibility rules on hidden fields
They are about summary is not displayed
Comment #4
Tresler CreditAttribution: Tresler commentedJust curious, does anything else need to happen to get this applied? Do I need to send a merge request of something?
Comment #5
blackandcode CreditAttribution: blackandcode commentedI have the same problem. Used patch #2 and now problem desapear. I think this is very major bug!!!! So please commit it as soon as possible.
Comment #6
andypostActually the problem in a way that ctools stores config values, so first we need to fix form and submit hanler, see details in #1630820-15: entity_field_value is completely broken
Comment #7
andypostSuppose this change makes sense as stand-alone
PS: Fix for false positives #1630820-24: entity_field_value is completely broken
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed.