Class 'view' not found in /home/.matanmi/user/mysite.com/drupal-6.2/includes/common.inc(1537) : eval()'d code on line 1
I tried to export and add a new block, when placing the exported code and assigning the block area , I recieved this error message. When using display on the views it returned a display, when exporting to a block it created this error as stated above
This is the export information:
$view = new view;
$view->name = 'friends_list_viewpage';
$view->description = 'view friends on profile page block';
$view->tag = 'friends_list_block_view';
$view->view_php = '';
$view->base_table = 'users';
$view->is_cacheable = 0;
$view->api_version = 2;
$view->disabled = FALSE; // Edit this to true to make a default view disabled initially
$view->display = array();
$display = new views_display;
$display->id = 'default';
$display->display_title = 'Defaults';
$display->display_plugin = 'default';
$display->position = 0;
$display->display_options = array(
'style_plugin' => 'grid',
'style_options' => array(
'columns' => '6',
'alignment' => 'horizontal',
),
'row_plugin' => 'fields',
'row_options' => array(),
'relationships' => array(),
'fields' => array(
'delete_node' => array(
'id' => 'delete_node',
'table' => 'users',
'field' => 'delete_node',
'label' => 'Delete link',
'text' => '',
'relationship' => 'none',
),
'uid' => array(
'id' => 'uid',
'table' => 'users',
'field' => 'uid',
'label' => 'Uid',
'link_to_user' => TRUE,
),
'picture' => array(
'id' => 'picture',
'table' => 'users',
'field' => 'picture',
'label' => 'Picture',
'relationship' => 'none',
),
),
'sorts' => array(),
'arguments' => array(),
'filters' => array(),
'items_per_page' => 10,
'use_more' => 1,
);
$view->display['default'] = $display;
$display = new views_display;
$display->id = 'block';
$display->display_title = 'Block';
$display->display_plugin = 'block';
$display->position = 0;
$display->display_options = array(
'defaults' => array(
'access' => TRUE,
'title' => TRUE,
'header' => TRUE,
'header_format' => TRUE,
'header_empty' => TRUE,
'footer' => TRUE,
'footer_format' => TRUE,
'footer_empty' => TRUE,
'empty' => TRUE,
'empty_format' => TRUE,
'use_ajax' => TRUE,
'items_per_page' => TRUE,
'offset' => TRUE,
'use_pager' => TRUE,
'pager_element' => TRUE,
'use_more' => TRUE,
'distinct' => TRUE,
'link_display' => TRUE,
'style_plugin' => TRUE,
'style_options' => TRUE,
'row_plugin' => TRUE,
'row_options' => TRUE,
'relationships' => TRUE,
'fields' => TRUE,
'sorts' => TRUE,
'arguments' => TRUE,
'filters' => TRUE,
),
'relationships' => array(),
'fields' => array(),
'sorts' => array(),
'arguments' => array(),
'filters' => array(),
);
$view->display['block'] = $display;
Any ideas? I will admit to being a basic novice user, but slowly learning and loving drupal.
I did wrap <? ?> php around this and set my input to php as well
Comments
Comment #1
merlinofchaos commentedWhat do you mean by when exporting to a block
That phrase doesn't make sense to me.
Comment #2
TheresaM commentedi'm sorry, such a noob, i was doing it wrong,
Go to add new view.
Give it the name 'user_list', tag 'users', type 'User' and click Next.
On the left, select 'Page' and click Add Display.
Next to Fields click the + icon to add fields.
In the Group section select User, then check the following user fields: Created date, Delete link, Edit link, Last access, Name and Picture. Then click Add
You will be taken through the fields you added. For Delete link change the label to "Operations"; otherwise you can leave the options unchanged. Click Update to go to the next field.
Under Page settings, click the Path setting. Set the path to 'user_list' (or something else if you prefer.
Click the Menu setting. Select Normal menu entry and set the title to "User list".
At this point, you have done enough to create a valid view. If you scroll down, you will see a preview of your view. At any time you can click the Preview button, but whenever you finish one of the mini forms, the preview will update automatically, so you don't need to, generally.
Next to Fields click the rearrange icon, which is to the right of the + icon to add fields. Drag the Name field to the top and the Delete link (Operations) field to the bottom, and the Edit link field just above it. Then click Update
Under the Basic settings, click the Style setting, which should default to "Unformatted". Change this to "Table".
You will be taken to the table settings form. Next to Edit link change the column to Operations. Next to Operations set the Separator to " | " (note the spaces around the | symbol). Check all of the Sortable checkboxes, and set Default sort to Name.
Click the + icon next to Filters and add the User: Name filter. Select Is not one of and enter Anonymous in the Usernames.
Click on Use pager and change it to Full.
Click on the add arguments icon, and add the User: Roles argument. Set the title to "%1", the "Action to take if argument is not present" to "Summary, sorted ascending", and leave the other settings as they are.
Click Save.
At the very top, click View "Page" to go to your new view!
the export is to export the view to another site, and not copy the code to a block . went to learn bythedrop.com and watched his video as well .
Comment #3
merlinofchaos commentedSounds like this can be marked fixed, then.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.