Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#11 | 1190510-fix.patch | 702 bytes | dawehner |
#10 | 1190510-followup.patch | 702 bytes | andypost |
#9 | fixed-notice-undefined-index-area-issue-1190510.patch | 660 bytes | neoglez |
#8 | var_dump.PNG | 27.27 KB | neoglez |
invalid.PNG | 10.16 KB | neoglez |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedHm. Aliases is supposed to be optional!
Comment #2
neoglez CreditAttribution: neoglez commentedWell, just add any item...
Comment #3
neoglez CreditAttribution: neoglez commentedIf working with ajax this goes wrong.
Comment #4
dawehnerCan 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.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedThis 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.
Comment #6
neoglez CreditAttribution: neoglez commented@dereine deactivate JS on the browser.
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?
Comment #7
neoglez CreditAttribution: neoglez commentedComment #8
neoglez CreditAttribution: neoglez commentedWell, 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:
let's say $type is header (i want to add a header) then after this code $type = 'area' and then
There is no 'area' key for the $types array!
Comment #9
neoglez CreditAttribution: neoglez commentedPosting patch for Notice: Undefined index area in views_ui_add_item_form.
Comment #10
andypostAt first #5 commit is broken because is_array(empty(... always FALSE
Please roll this back
Comment #11
dawehner@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.
Comment #12
andypost@dereine That's what I mean in #10. Please commit it.
Comment #13
dawehnerUps, true. Thanks! Commited to 7.x-3.x