When enabling the module, I now get the above notice on my context adming page. Whilst it isn't the end of the world, it would be good to tidy this up.
After a quick look at the code in question, I found the line causing the error was line72 in context_reaction_addassets_base.inc:
$form[$key][$path] = array(
'#title' => $file_name,
'#type' => 'checkbox',
'#return_value' => $path,
'#default_value' => isset($values[$key][$path]) ? $values[$key][$path] : array(),
);
I had a very quick look, and believe that the default_value for 'checkbox' is meant to be a string. Whereas 'checkboxes' expects an array back. When I replaced the array() part with '' it resolved the issue on my local version just fine.
Was this by design, or is it something we should patch?
Dan
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | context_addassets-2064049-1.patch | 1023 bytes | heddn |
Comments
Comment #1
Anonymous (not verified) commentedI can confirm that making the change worked for me too. So far, not seeing any other problems on the site as a result.
Comment #2
proteo commentedHad the same issue, but got the error repeated about 20 times with each page load. The proposed fix in #1 seems to work fine so far, maybe it could be included in the next dev release?
Comment #3
longwaveThe change in #1 works for me.
Comment #4
heddnRolled into a patch.
Comment #5
jojonaloha commentedThe patch in #4 applied and works as it should. I was getting 100's of these notices anytime I edited a context.
Comment #6
jtwalters commentedI think '0' would be a valid value as well. But this probably works.
Another related issue should also resolve this. See: https://www.drupal.org/node/2195611
Comment #7
novitsh commentedTested this patch. It's still valid. Good to go.
Comment #9
electblake commented