Issue with custom view modes

1 reply [Last post]
shubhkaran
Offline
Last seen: 9 years 30 weeks ago
Joined: 2012-01-05

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

Chris Shattuck
Offline
Last seen: 9 weeks 5 days ago
Joined: 2009-08-16
Hello shubhkaran, Just out of

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

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:


Loading...
Contact us

Below are the supported keyboard shortcuts for our video player.

space
Start / stop video
shift
Go to next video
shift
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
1...9
Jump to a percentage (2 is 20%, for example)
f
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
$29
1 month
$156
6 months
10% off
$276
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
user
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.