Hi,

I'm new to all this, but here goes what I found:

This is an export of my view - it's basically just to show a blog as a newsfeed on the front page.


$view = new view;
$view->name = 'NewsFeed';
$view->description = 'This is the newsfeed on the front page';
$view->tag = 'Newsfeed';
$view->view_php = '';
$view->base_table = 'node';
$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 = 'Newsfeed';
  $display->display_plugin = 'default';
  $display->position = '1';
  $display->display_options = array (
  'style_plugin' => 'default',
  'style_options' => 
  array (
  ),
  'row_plugin' => 'fields',
  'row_options' => 
  array (
  ),
  'relationships' => 
  array (
  ),
  'fields' => 
  array (
    'title' => 
    array (
      'id' => 'title',
      'table' => 'node',
      'field' => 'title',
    ),
    'created' => 
    array (
      'id' => 'created',
      'table' => 'node',
      'field' => 'created',
      'date_format' => 'small',
      'custom_date_format' => '',
    ),
    'body' => 
    array (
      'id' => 'body',
      'table' => 'node_revisions',
      'field' => 'body',
    ),
  ),
  'sorts' => 
  array (
    'sticky' => 
    array (
      'id' => 'sticky',
      'table' => 'node',
      'field' => 'sticky',
      'order' => 'ASC',
    ),
    'created' => 
    array (
      'id' => 'created',
      'table' => 'node',
      'field' => 'created',
      'order' => 'DESC',
    ),
  ),
  'arguments' => 
  array (
  ),
  'filters' => 
  array (
    'type' => 
    array (
      'id' => 'type',
      'table' => 'node',
      'field' => 'type',
      'operator' => 
      array (
        'operator' => 'in',
      ),
      'value' => 
      array (
        'value' => 
        array (
          'blog' => 'blog',
          'page' => 0,
          'story' => 0,
        ),
      ),
      'group' => 0,
    ),
    'uid' => 
    array (
      'id' => 'uid',
      'table' => 'users',
      'field' => 'uid',
      'operator' => 
      array (
        'operator' => '=',
      ),
      'value' => 
      array (
        'value' => '1',
      ),
      'group' => 0,
    ),
  ),
  'items_per_page' => 10,
);
$view->display['default'] = $display;
  $display = new views_display;
  $display->id = 'block';
  $display->display_title = 'Block-Newsfeed';
  $display->display_plugin = 'block';
  $display->position = '2';
  $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,
    'items_per_page' => true,
    'offset' => true,
    'use_pager' => true,
    'pager_element' => true,
    'link_display' => true,
    'php_arg_code' => true,
    'exposed_options' => 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;

All went well when doing the view, however, once I go to the menu "blocks" and I click "configure" I get this error:

Fatal error: Cannot use string offset as an array in /home/(**my-account**)t/public_html/(**my-domain**)/includes/form.inc on line 965

Not sure if the error comes from Views or Blocks - I suspect views because all other blocks seem to work just fine - but I might be wrong.

CommentFileSizeAuthor
#3 views-block-configure.patch579 bytessym

Comments

sym’s picture

Same problem here.

Imported that view, changed the node type to 'page' (I don't have 'blog' content type) and went to configure that block on the block admin page (admin/build/block/configure/views/new%20view-block).

So this is obviously a problem in views_block (in views.module).

    case 'configure':
    case 'list':
    case 'view':
      list($name, $display_id) = explode('-', $delta);
      // Load the view
      if ($v = views_get_view($name)) {
       $view = drupal_clone($v);
        if ($view->access($display_id)) {
          return $view->execute_display($display_id);
        }
      }
      break;

I can't see what will happen on the configure page. Removing "case 'configure':" fixes the problem, but I don't know if I am removing some feature in the process.

merlinofchaos’s picture

I think the default block handler in Views isn't handling 'configure' right (it should do nothing at all). Thanks for this.

sym’s picture

Version: 6.x-2.0-alpha2 » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new579 bytes

Not really worth patching, but this is what I did to fix it.

Rysk’s picture

esiest way to get around this is to build you views as you would normally with the block view, but don't call on it. When you go into the configure blocks area, make a custom block, and choose php input type. Call your views block from within your custom block. I know it's a pain and kind of a roundabout way to do this, but this way you still get your custom views and the ability to configure the blocks the way you normally would.

  $view = views_get_view('your_view');
  print views_build_view('block', $view, array(), false, 8);

If you aren't php savvy with drupal yet, you can get the basic explanation for the function call here
http://drupal.org/node/99721

ezra-g’s picture

I can confirm this error. The patch in #3 allows me to edit the block successfully and does not seem to cause other errors.

merlinofchaos’s picture

Status: Needs review » Fixed

I went ahead and committed this fix; there's no point in trying to pass 'configure' thorugh to the handler at this time. This will go out in alpha3.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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