Using the alpha3 release, I am unable to add an area plugin to a view. I can select one from the list, but when I click "Add" instead of a config form I get an empty area.

CommentFileSizeAuthor
#1 views-765310.patch612 bytesdawehner

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new612 bytes

The thing is, headers are not always converted.

The code before:

    foreach (array('header', 'footer', 'empty') as $area) {
      $converted = FALSE;
      if (isset($this->options[$area]) && !is_array($this->options[$area])) {
        if (!empty($this->options[$area])) {
          $content = $this->get_option($area);
          if (!empty($content) && !is_array($content)) {
            $format = $this->get_option($area . '_format');
            $options = array(
              'id' => 'area',
              'table' => 'views',
              'field' => 'area',
              'label' => '',
              'relationship' => 'none',
              'group_type' => 'group',
              'content' => $content,
              'format' => !empty($format) ? $format : variable_get('filter_default_format', 1),
            );

            if ($area != 'empty' && $empty = $this->get_option($area . '_empty')) {
              $options['empty'] = $empty;
            }
            $this->set_option($area, array('text' => $options));
            $converted = TRUE;
          }
        }
      }
      // Ensure that options are at least an empty array
      if (!$converted) {
        $this->set_option($area, array());
      }

sure converted is false, when no conversion happend, but this is on a new views3 view always the case, there is no need for a conversion.

So i moved it up one level. Perhaps it could be also moved up another level under if (!empty($this->options[$area])) {

Crell’s picture

I don't fully understand what you said, but I applied the patch and it fixed the issue for me. Leaving as needs review for now in case it needs sanity checking.

dagmar’s picture

Status: Needs review » Reviewed & tested by the community

Ok, it is working fine. I have tested it in a fresh drupal install and in a upgrade from views 2 to views 3.

Related to

Perhaps it could be also moved up another level under if (!empty($this->options[$area])) {

Is the same result in a fresh install, but as is this patch works.

endiku’s picture

Thanks, that did the trick for me as well. Wasn't able to add the global text area for Empty text in views3.

Which I needed because it seems an exposed filter that results in no matches was removing the entire view including the exposed form element, meaning no more ability to search. Empty text fixes that but I don't want to make a new issue out of it until I'm sure.

dagmar’s picture

Status: Reviewed & tested by the community » Fixed

@endiku please fill a new issue with your problem. Explain better what is happening and export your view. Thanks.

Ok, this issue was commited http://drupal.org/cvs?commit=352156 I'm marking it as fixed.

bsorrells’s picture

I can confirm that views-765310.patch fixes my problem of not being able to add a header, footer, or empty text.

dawehner’s picture

tststs, this commit message was wrong :) Hehe if it does not work, dagmar can be clamed :)

crutch’s picture

ditto: I can confirm that views-765310.patch fixes my problem of not being able to add a header, footer, or empty text.

Status: Fixed » Closed (fixed)

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

JGonzalez’s picture

Patch fixes problem, however, was this not commited to alpha3?

JGonzalez’s picture

Status: Closed (fixed) » Active
dawehner’s picture

Version: 6.x-3.0-alpha3 » 6.x-3.x-dev
Status: Active » Fixed

It was commited to the dev version.

Status: Fixed » Closed (fixed)

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