Problem/Motivation
I am receiving this warning 1071 times on /admin/panopoly/panes
Warning: array_key_exists() expects parameter 2 to be array, null given in panopoly_admin_general_panes_content_type_render() (line 44 of /sites/all/modules/contrib/panopoly_admin/plugins/content_types/general_panes.inc).
Steps to Reproduce
Environment
PHP 5.5.9
Apache 2.2.24
OS X Mavericks
Minimum Setup:
drush dl drupal
drush si --db-url=mysql://root:root@localhost/panopoly --account-name=admin --account-pass=admin standard
drush dl panopoly --select 1
drush en panopoly_admin -y
Login and go to http://localhost/admin/panopoly/panes
Proposed resolution
@todo
Remaining tasks
- Confirm issue
- Write patch
- Review Patch
- Commit Patch
API changes
n/a
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2198865-3-panels-page-variable-array-default.patch | 933 bytes | joelpittet |
Comments
Comment #1
joelpittetComment #2
joelpittetComment #3
joelpittetvariable_get() allows you to set a default and in this case array() would be a better default to expect, this fixes the issue. Though maybe this line could have a second look at the logic:
$category_enabled = (!empty($panels_page_default_types[$category_name]) || !array_key_exists($category_name, $panels_page_default_types)) ? TRUE : FALSE;Maybe it should be:
Reference:
http://www.zomeoff.com/php-fast-way-to-determine-a-key-elements-existanc...
Comment #4
mrfelton commentedCommitted a fix for this based on the patch above in http://drupalcode.org/project/panopoly_admin.git/commit/b88dea5.