It seems to me that all the following keys (title', 'group', 'help', 'base', 'aliases') are mandatory in hook_views_data.
I think the error on the picture is realted to that.
See views_ui_add_item_form function.
How to reproduce:
Just add a header.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Hm. Aliases is supposed to be optional!

neoglez’s picture

How to reproduce:
Just add a header.

Well, just add any item...

neoglez’s picture

Priority: Normal » Major

If working with ajax this goes wrong.

dawehner’s picture

Can you try to describe how to reproduce the error?

I tryed to add fields to different entities etc. and don't get the problem here.

merlinofchaos’s picture

Status: Active » Fixed

This is interesting. I think this means something is actually using the key 'aliases' somewhere, and that's the problem. It's not an array.

Committed a fix to check to see that it's an array.

neoglez’s picture

Priority: Major » Normal

@dereine deactivate JS on the browser.

If working with ajax this goes wrong.

Exactly the other way around: it seems the error doesn't show.

First i have to say that the error is gone with the commit in #5 (1b903708db62e9c6e5544a5687c7ac6a74fdc140) and if i remove it the error is back again (tested in two different computers with totally diferents Drupal install).
Something i noticed: the 'aliases' key still will go through the foreach loop in views_fetch_fields (line 4863) but becouse this key is not defined (is supposed to be optional) it will be written to this entry "Error: missing @component" (you can test this with var_dump), what's that supossed to mean?

neoglez’s picture

Status: Fixed » Active
neoglez’s picture

FileSize
27.27 KB

Well, i think we're dealing here with two things:
One is the 'aliases' situation (by the way i attach a var_dump picture) as explained in #6.
The otherone is the Notice: Undefined index area in views_ui_add_item_form (see picture in #0). The problem is that depending on what views_object_types returns the key 'type' is gonna be present or not:

  $types = views_object_types();
  $ltitle = $types[$type]['ltitle'];
  if (!empty($types[$type]['type'])) {
    $type = $types[$type]['type'];
  }

let's say $type is header (i want to add a header) then after this code $type = 'area' and then

$types[$type]['ltitle'])

There is no 'area' key for the $types array!

neoglez’s picture

Status: Active » Needs review
FileSize
660 bytes

Posting patch for Notice: Undefined index area in views_ui_add_item_form.

andypost’s picture

FileSize
702 bytes

At first #5 commit is broken because is_array(empty(... always FALSE

Please roll this back

dawehner’s picture

FileSize
702 bytes

@neoglez
In general i think new issues are always better then opening the old one.
You can link the new one in the old one.

@andypost
Here is a patch which fixes the problem in general.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

@dereine That's what I mean in #10. Please commit it.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Ups, true. Thanks! Commited to 7.x-3.x

Status: Fixed » Closed (fixed)

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