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

CommentFileSizeAuthor
#4 context_addassets-2064049-1.patch1023 bytesheddn

Comments

Anonymous’s picture

I can confirm that making the change worked for me too. So far, not seeing any other problems on the site as a result.

<?php
        $form[$key][$path] = array(
          '#title' => $file_name,
          '#type' => 'checkbox',
          '#return_value' => $path,
          '#default_value' => isset($values[$key][$path]) ? $values[$key][$path] : '',
        );
?>
proteo’s picture

Had 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?

longwave’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

The change in #1 works for me.

heddn’s picture

StatusFileSize
new1023 bytes

Rolled into a patch.

jojonaloha’s picture

The patch in #4 applied and works as it should. I was getting 100's of these notices anytime I edited a context.

jtwalters’s picture

I 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

novitsh’s picture

Tested this patch. It's still valid. Good to go.

  • electblake committed 1cf409b on
    Issue #2064049 by heddn,jritterbush,longwave,Novitsh - Fixed Notice "...
electblake’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.