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.
Views displaying users seem to miss "Description Content" from data sources.
I received the following error:
Notice: Undefined index: description_field in openlayers_views_style_data->map_features() (line 298 of /.../sites/all/modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc).
and then saw that the view simply does not have Description Content in data sources. There's an attached images demonstrating the bug.
Comment | File | Size | Author |
---|---|---|---|
#9 | 0001-Issue-1370080-description_field-attribute-issues.patch | 3.55 KB | Pol |
#5 | 1370080-5.patch | 3.02 KB | vasike |
problem-preview.png | 24.76 KB | Kaloyan Petrov |
Comments
Comment #1
Kaloyan Petrov CreditAttribution: Kaloyan Petrov commentedIs somebody aware why the Description Field is only added for views of type "node"?
openlayers_views_style_data.inc, line 184:
// For node content type, we can render the node as with a specific
// view mode.
if ($this->view->base_table == 'node')
Comment #2
7wonders CreditAttribution: 7wonders commentedAlso wondering this. Commenting out/deleting line 186 and 227 (latest dev release) seemed to do the trick for me and got rid of the error but I dont know what other probs it will cause!
Undefined index: description_field in openlayers_views_style_data
Comment #3
rafaqz CreditAttribution: rafaqz commentedThis is happening for my node based data overlays as well. I lose the description field dropdown whenever the master views style is not also set to "data overlay", and I'm assuming that's why it has happened to kayolan and 7wonders. Its pretty disastrous when it happens but there is a workaround, and for now I have set my master displays as data overlay and it seems to be ok.
It seems to be a bug with the handling of descriptions for individual view displays. I would help but my PHP isn't really up to writing a patch at this stage.
Comment #4
vasikeI thinks this is more generic issue, here are some aspects i could think about
1. Not available for all entities types, limited to node entities type
maybe this could be implemented for any type (Display suite could help for view modes)
2. this attribute it is used without an isset checking: missing "description_field/Description Content" attributes throw this error.
So maybe 1. could be a different new feature request issue and 2. could be solved here.
Comment #5
vasikethis is a patch to get rid of this notice messages
Comment #6
ckrinaGreat: #5 patch worked for me.
I'm getting data from comment fields in a view.
Thanks.
Comment #7
zzolo CreditAttribution: zzolo commented#5: 1370080-5.patch queued for re-testing.
Comment #8
zzolo CreditAttribution: zzolo commentedHey @vasike. Thanks for the patch, but for some reason I was not able to apply it. Did you do it with git diff?
Comment #9
PolRe-rolled the patch for 7.x-2.x, needs feedback.
Comment #10
ifrikTried the patch against the latest dev version in #9 and did not get any error messages
Comment #11
PolThanks :)
Comment #12
mgriebe CreditAttribution: mgriebe commentedI have applied the patch in #9 on a new install of dev. I get no error messages. But, I do not have a description field either.
The stable version allows for a description field for any entity in maps without the master page being openlayer.
***EDIT I managed to unintentionally update to 7.x-3.x-dev. This patch does indeed work for 7.x-2.x***