Hey everyone,

I have a panel that is overriding the standard node page. If I add a new text field to the panel, but don't add any data to that field (the field is empty), then I get the following notice:

Notice: Undefined index: #title in ctools_entity_field_content_type_render() (line 103 of /Users/ben/drupal7/profiles/commerce_kickstart/modules/contrib/ctools/plugins/content_types/entity_context/entity_field.inc).

I'm using the latest -dev versions of Panels and CTools.

Thanks,
Ben

CommentFileSizeAuthor
#9 1165546-fix-empty-values.patch1.24 KBmerlinofchaos

Comments

Letharion’s picture

Status: Active » Postponed (maintainer needs more info)

Hello!

Unfortunately, this issue has remained open, without activity, for a very long time. I hope you can understand that between maintaining the module, work, and other obligations, the maintainers are very busy. This leads to not all issues being answered.

In order to figure out which bugs that are still present, I'm going over all low activity bug reports that has not been touched for 6 months, and marking them "Postponed, needs info". In many cases, I expect the bug to have been solved by a newer version of Panels..

If you can still reproduce this issue with the latest dev version of Panels, please just reset it's status to active, and we'll try to work it out. Please remember to post any new information that may be relevant, such as any attempts of your own at debugging.

Regards, Letharion

Letharion’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

A month has passed, and I'm going over the issue queue ones more. Some issues have been closed for other reasons, some re-opened, but this issue has remained silent for the past month.
Because of this, I'm doing a bulk close of a number off issues. I'm sorry that it happened this way, but the issue queue has had to few contributors, and to many questions.

Again, as said in the previous comment, feel free to re-open the issue by setting it to active, if you still need help.

Regards, Letharion.

videographics’s picture

Status: Closed (cannot reproduce) » Active

I'm seeing a similar message with the very latest dev version of ctools and panels. I too have some empty text fields.

Undefined index: und in ctools_entity_field_content_type_render() (line 122 of example.com/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc

NimbyDagda’s picture

We are also having the same issue where there are empty fields on entities which are being rendered with an alternative page layout. It is the same error message as above of

Undefined index: und in ctools_entity_field_content_type_render() (line 122 of /sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc)

This seems to be an error in the code as it doesn't check to see if a field is empty before assuming there is an undefined locale entry.

We have temporarily fixed it locally by sticking in an isset() check, but as I am not familiar with exactly what is going on I don't know if that is all that is necessary for a fix.

i.e line 122 in our fixed version is now

$all_values = isset($entity->{$field_name}[$language]) ? $entity->{$field_name}[$language] : array();

franzkewd’s picture

Same errors as #4. Fixed those as per #4 too.

Cheers.

Letharion’s picture

Status: Active » Postponed (maintainer needs more info)

What is the language setup on the sites that get this?

franzkewd’s picture

I have Drupal 7.10, both core Locale and Content Translation disabled, Panels 7.3.dev.
It was fine on the previous Ctools 7.1.dev. The error showed up upon upgrading to the recent Ctools 7.1.dev of Jan. 10, 2012.

Letharion’s picture

Status: Postponed (maintainer needs more info) » Active
merlinofchaos’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB

Ok, #4 and on are really not what this issue is about. People, please be more careful when comparing error messages. Just because they happen in similar parts of the code, these are really not at all the same error. So the issue has been effectively hijacked.

Plus, I should've checked out a patch a little more deeply that caused this.

Try this patch, please.

merlinofchaos’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 7.x-3.x-dev » 7.x-1.x-dev

Also, the line of code mentioned is totally in CTools. I know it's not always easy to get the module right but when you're actually looking at a line of code in a module, it should be easier.

renat’s picture

Unfortunately, patch from #9 gave other problems. Some pages with panels return WSOD after applying it. There are such message in the error.log:

PHP Fatal error: Cannot access empty property in /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc on line 275, referer: http://sky37.pp.ua/en

It should be noted, though, that this WSOD appears only for English and Russian variants of the page, French version loads, but there are no content and bunch of error notices:

Notice: Undefined variable: clone_type in ctools_entity_field_content_type_render() (line 155 of /var/www/sky37.pp.ua/public_html/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7403 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7404 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).
Notice: Undefined variable: clone_type in ctools_entity_field_content_type_render() (line 155 of /var/www/sky37.pp.ua/public_html/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7403 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7404 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).
Notice: Undefined variable: clone_type in ctools_entity_field_content_type_render() (line 155 of /var/www/sky37.pp.ua/public_html/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7403 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7404 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).

And in admin/reports section there are even more:

Notice: Undefined variable: clone_type in ctools_entity_field_content_type_render() (line 155 of /var/www/sky37.pp.ua/public_html/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7403 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: entity keys in entity_extract_ids() (line 7404 of /var/www/sky37.pp.ua/public_html/includes/common.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).
Notice: Undefined index: field_name in field_language() (line 275 of /var/www/sky37.pp.ua/public_html/modules/field/field.multilingual.inc).

Drupal 7.10, Chaos tool suite 7.x-1.x-dev (2012-jan-10), Internationalization 7.x-1.3, Panels 7.x-3.x-dev (2011-Dec-07). English, French and Russian languages are enabled, English is default. All problematic pages have English as their source language. Cache cleared multiple times.

renat’s picture

Tested patch from #9 against Chaos tool suite 7.x-1.0-rc1+80-dev (2012-Янв-16). Problems, mentioned in #11, are still there.

grossmann’s picture

I applied the patch of #9 but there seems to be an error on line 155 in the patch. I get the following error on the panel where the prepatch error of #4 happened.

Fatal error: Cannot access empty property in /var/www/web/drupal7/modules/field/field.multilingual.inc on line 275
Call Stack
#	Time	Memory	Function	Location
1	0.0001	60176	{main}( )	../index.php:0
2	0.2938	35225436	menu_execute_active_handler( )	../index.php:21
3	0.2946	35291424	call_user_func_array ( )	../menu.inc:503
4	0.2946	35291536	page_manager_term_view_page( )	../menu.inc:0
5	0.3060	36223832	ctools_context_handler_render( )	../term_view.inc:124
6	0.3170	37175500	ctools_context_handler_render_handler( )	../context-task-handler.inc:44
7	0.3171	37175500	panels_panel_context_render( )	../context-task-handler.inc:103
8	0.3223	37464192	panels_render_display( )	../panel_context.inc:287
9	0.3223	37464192	panels_display->render( )	../panels.module:1056
10	0.3223	37464192	panels_renderer_standard->render( )	../panels.module:728
11	0.3224	37466092	panels_renderer_standard->render_layout( )	../panels_renderer_standard.class.php:349
12	0.3294	38084380	panels_renderer_standard->render_panes( )	../panels_renderer_standard.class.php:378
13	0.3336	38358660	panels_renderer_standard->render_pane( )	../panels_renderer_standard.class.php:457
14	0.3336	38358660	panels_renderer_standard->render_pane_content( )	../panels_renderer_standard.class.php:476
15	0.3336	38358660	ctools_content_render( )	../panels_renderer_standard.class.php:541
16	0.3424	38534896	ctools_entity_field_content_type_render( )	../content.inc:278
17	0.3566	38580268	field_view_field( )	../entity_field.inc:155
18	0.3574	38693372	field_language( )	../field.module:919

And on a working panel (prepatch) I get this.

Notice: Undefined variable: clone_type in ctools_entity_field_content_type_render() (line 155 of /var/www/web/drupal7/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc).
    Notice: Undefined index: entity keys in entity_extract_ids() (line 7403 of /var/www/web/drupal7/includes/common.inc).
    Notice: Undefined index: entity keys in entity_extract_ids() (line 7404 of /var/www/web/drupal7/includes/common.inc).
    Notice: Undefined index: field_name in field_language() (line 275 of /var/www/web/drupal7/modules/field/field.multilingual.inc).
    Notice: Undefined index: field_name in field_language() (line 275 of /var/www/web/drupal7/modules/field/field.multilingual.inc).

I have no other language than the default english in use.
grossmann-mcs

P.s. the original hijacked issue seems to be a duplicate of http://drupal.org/node/1153394

NimbyDagda’s picture

Same error, here.

I have temporarily fixed it by using the $entity_type rather than $clone_type since I assume thats what was intended. i.e.

replaced
$field_output = field_view_field($clone_type, $clone, $field_name, $field_settings, $language);
with
$field_output = field_view_field($entity_type, $clone, $field_name, $field_settings, $language);

Also sorry for my original post being the wrong issue, I was responding to the one directly above it which did have the same error as mine.

merlinofchaos’s picture

Status: Needs review » Fixed

#14: Thanks for the report!

Committed and pushed the fixed patch using $entity_type rather than $clone_type.

Status: Fixed » Closed (fixed)

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