Issue with custom view modes
I'm having an issue with code provided with the chapter "How to work with Nodes" as part of the "Drupal 7 Development Core Concepts" video series. The specific video is:
I tried the sample module "stuff" which adds a custom view mode. This is causing a few errors - while accessing the page using the view mode it gives the warning/notice:
Notice: Undefined index: stuff_backup_owner in field_get_display() (line 692 of /Applications/MAMP/htdocs/drupal710/modules/field/field.module).
When I go to the You are here
Home » Administration » Structure » Content types » Basic page
and click on "Manage Display" and then on the tab for the custom view ('Special formatting for backup user' as per the code in the module), it gives a blank screen and I get the following stack trace in php_error.log.
Is there something I'm missing, or some correction that needs to be made to the module code to make this work properly? Would really appreciate help with this!
[15-Jan-2012 01:18:23] PHP Fatal error: Unsupported operand types in /Applications/MAMP/htdocs/drupal710/modules/field_ui/field_ui.admin.inc on line 992
[15-Jan-2012 01:18:23] PHP Stack trace:
[15-Jan-2012 01:18:23] PHP 1. {main}() /Applications/MAMP/htdocs/drupal710/index.php:0
[15-Jan-2012 01:18:23] PHP 2. menu_execute_active_handler() /Applications/MAMP/htdocs/drupal710/index.php:21
[15-Jan-2012 01:18:23] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/drupal710/includes/menu.inc:503
[15-Jan-2012 01:18:23] PHP 4. drupal_get_form() /Applications/MAMP/htdocs/drupal710/includes/menu.inc:0
[15-Jan-2012 01:18:23] PHP 5. drupal_build_form() /Applications/MAMP/htdocs/drupal710/includes/form.inc:123
[15-Jan-2012 01:18:23] PHP 6. drupal_retrieve_form() /Applications/MAMP/htdocs/drupal710/includes/form.inc:329
[15-Jan-2012 01:18:23] PHP 7. call_user_func_array() /Applications/MAMP/htdocs/drupal710/includes/form.inc:785
[15-Jan-2012 01:18:23] PHP 8. field_ui_display_overview_form() /Applications/MAMP/htdocs/drupal710/includes/form.inc:0
[15-Jan-2012 01:18:23] PHP Fatal error: Unsupported operand types in /Applications/MAMP/htdocs/drupal710/modules/field_ui/field_ui.admin.inc on line 992
[15-Jan-2012 01:18:23] PHP Stack trace:
[15-Jan-2012 01:18:23] PHP 1. {main}() /Applications/MAMP/htdocs/drupal710/index.php:0
[15-Jan-2012 01:18:23] PHP 2. menu_execute_active_handler() /Applications/MAMP/htdocs/drupal710/index.php:21
[15-Jan-2012 01:18:23] PHP 3. call_user_func_array() /Applications/MAMP/htdocs/drupal710/includes/menu.inc:503
[15-Jan-2012 01:18:23] PHP 4. drupal_get_form() /Applications/MAMP/htdocs/drupal710/includes/menu.inc:0
[15-Jan-2012 01:18:23] PHP 5. drupal_build_form() /Applications/MAMP/htdocs/drupal710/includes/form.inc:123
[15-Jan-2012 01:18:23] PHP 6. drupal_retrieve_form() /Applications/MAMP/htdocs/drupal710/includes/form.inc:329
[15-Jan-2012 01:18:23] PHP 7. call_user_func_array() /Applications/MAMP/htdocs/drupal710/includes/form.inc:785
[15-Jan-2012 01:18:23] PHP 8. field_ui_display_overview_form() /Applications/MAMP/htdocs/drupal710/includes/form.inc:0
Hello shubhkaran,
Just out of curiosity, have you tried clearing your caches? If that doesn't do the trick, I'll have to give it a go and see what might be going on.
Cheers!
Chris