Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Drupal 6.14, acquia_prosper theme, skinr module enabled.
I'm using the Advanced Profile Kit -- and get this error when editing the panel (pane settings). Seems there is no "formatter" available in the drop-down list for this CCK text field? I'm unable to change the heading of the pane as a result and get the message "An illegal choice has been detected. Please contact the site administrator."
Comment | File | Size | Author |
---|---|---|---|
#11 | content_panels-589306-11.patch | 997 bytes | markus_petrux |
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedIt looks like the information stored by CCK related to this field has been somehow corrupted.
Make sure the module that implements the field is enabled.
I would suggest going to the Manage fields page of the corresponding content type, then edit the field settings and save. That should rebuild this data. Also, visit the "Display fields" page and repeat the operation. Make sure that field shows up in both pages.
BTW, the file content_field.inc should be located in cck/includes/panels/content_types, not in cck/includes/panels. If it is not a copy/paste issue while opening this request, then it seems your CCK installation is not correct.
Comment #2
schuster211 CreditAttribution: schuster211 commentedI may have truncated the warning message when pasting: here is the error:
warning: Invalid argument supplied for foreach() in /home/hoursch5/public_html/pride/sites/all/modules/cck/includes/panels/content_types/content_field.inc on line 166.
Thanks for looking at this issue. I tried your suggestions -- the CCK text module that implements this field is enabled. I took the steps you prescribed in "Manage Fields" and "Display Fields". The panel editing still gives the same warning. I also disabled all of CCK, deleted the module (but did not uninstall) unzipped a fresh copy and re-enabled CCK (back to 6.x-2.5 this time) to see if that was the bugaboo. Ran database update ... took a look in the database files themselves to see if there was anything wildly amiss (that the uninformed eye could spot anyway.)
These field were created as part of the Advanced Profile Kit install process using "import content" feature. Dunno if that's a clue. Still have the problem. Thank you again for your support.
Comment #3
markus_petrux CreditAttribution: markus_petrux commentedLet's see. Line 166 in content_field.inc is the foreach loop in the following snippet.
If
$type_info['formatters']
is not an array, it is probably because:a) $field = content_fields($field_name); returns data that is not correct.
b) $field_types = _content_field_types(); does not contain information about the field type.
So we need to see what these functions return. We can do this adding watchdog statemets as follows:
Then, please repeat the operation in panels that generates the error, then visit the Recent log entries report and copy/paste the results here.
Comment #4
schuster211 CreditAttribution: schuster211 commentedOk. So I edited the content_field.inc script per your instruction (I think).
And looked in the log file after attempting the same operation as before.
Here's what I found:
Type debug
Date Monday, September 28, 2009 - 8:12am
User webmaster
Location http://www.foo.com/panels/ajax/configure/panel_context%3Auser_view%3Ause...
Referrer http://www.foo.com/admin/build/pages/nojs/operation/user_view/handlers/u...
Message $field: NULL
Severity debug
and
Details
Type debug
Date Monday, September 28, 2009 - 8:12am
User webmaster
Location http://www.foo.com/panels/ajax/configure/panel_context%3Auser_view%3Ause...
Referrer http://www.foo.com/admin/build/pages/nojs/operation/user_view/handlers/u...
Message $type_info: NULL
Severity debug
Plus
Type debug
Date Monday, September 28, 2009 - 8:12am
User webmaster
Location http://www.foo.com/panels/ajax/configure/panel_context%3Auser_view%3Ause...
Referrer http://www.foo.com/admin/build/pages/nojs/operation/user_view/handlers/u...
Message $field: NULL
Severity debug
and
Type debug
Date Monday, September 28, 2009 - 8:12am
User webmaster
Location http://www.foo.com/panels/ajax/configure/panel_context%3Auser_view%3Ause...
Referrer http://www.foo.com/admin/build/pages/nojs/operation/user_view/handlers/u...
Message $type_info: NULL
Severity debug
So it seems that NULL is stored where something else should be -- but why I wonder?
Comment #5
markus_petrux CreditAttribution: markus_petrux commentedIt could be because $field_name does not containt a valid field name. We could see this using the same method as above:
The value of $field_name should look something like 'field_xxx'.
Regarless of the value of $field_name there seems to be something wrong in the panel. The list of fields available for the panel is generated using content_types() and _content_field_types() in function content_content_field_content_type_content_types() and those function retrive the data from the same place as the code we're looking at now. so if there's data when the list of field is passed to panels, then I do not understand why this data is not available from the settings form of the ctools content type.
This is really strange, because CCK panels integration seems to work elsewher, so I'm not sure how to proceed from here.
Maybe you need to run update.php? clear caches?
Comment #6
schuster211 CreditAttribution: schuster211 commentedThe field name may be the problem. Looks a bit funny with the 'uprofile:' bit appended to it.
Details
Type debug
Date Monday, September 28, 2009 - 9:33am
User webmaster
Location http://www.foofoo.com/panels/ajax/configure/panel_context%3Auser_view%3A...
Referrer http://www.foofoo.com/admin/build/pages/nojs/operation/user_view/handler...
Message $field_name: 'uprofile:field_about_me'
Comment #7
markus_petrux CreditAttribution: markus_petrux commentedhmm... so it seems that you were using an old version of CCK Panels integration. One that was using the content type name and field name to key the ctools content types. This approach was not really accurate because fields can be shared between several content types, and so it was changed. Here's the issue:
#505278: Panels 3 and multiple node type fields.
Since there were issues with the old name, merlinofchaos suggested a patch that we applied to content_field.inc (see latest patch in that issue). However, it seems that workaround only fixes the ctools content type names during render. But here you're trying to edit the field settings, and maybe that conversion hack is not applied in this case.
So I would suggest removing the field from the panel, and then added back. The new version of the field will come with the new name, and that should fix this issue, hopefully.
Comment #8
markus_petrux CreditAttribution: markus_petrux commentedhmm... looking back at the fixes we made for backward compatibility, it seems we did nothing for the settings form. Here's a mini-patch that could possibly fix this:
Comment #9
markus_petrux CreditAttribution: markus_petrux commentedComment #10
dddave CreditAttribution: dddave commentedWhere do I have to put this code to test it? What needs to be replaced?
Comment #11
markus_petrux CreditAttribution: markus_petrux commentedPatch for CCK2 attached.
Comment #12
dddave CreditAttribution: dddave commentedI can confirm that this fixes the problems with APK. No more error message and now the "Field Formatter" field has an entry and also a dropdown. Hurray!
Anything else that needs to be tested?
Comment #13
markus_petrux CreditAttribution: markus_petrux commentedOk, thanks for the feedback. I have committed this patch to CCK2 and CCK3.
Hopefully this fixes all issues related to that change in the names of exposed CTools content types related to CCK fields.
However, it would still be nice if the new names where generated for the APK default panel. Related issue: #589518: Remove and re-add CCK fields on variant
Comment #14
venusrising CreditAttribution: venusrising commentedThis really screwed up my site too. I spent hours manually disabling modules via Phpmyadmin and now my custom profile I created is missing fileds I added that were grouped together. Does anyone have an idea how to fix this. I have read the above post but they seem just a bit different.
Comment #15
venusrising CreditAttribution: venusrising commentedI built my own profile and this is I now have missing fields etc.
Comment #16
markus_petrux CreditAttribution: markus_petrux commented@venusrising: If the patch in #11 does not fix your issue, then please open a separate report with as much information as possible to reproduce the problem.
Comment #17
schuster211 CreditAttribution: schuster211 commentedThis worked for me. Thanks! Brilliant work!