Using CiviCRM Contact as view source I get 4 times the error:

Notice: Undefined index: group_type in views_handler_field->query() (line 60 van /home/public_html/drupal-7-dev/sites/all/modules/views/handlers/views_handler_field.inc).

There is no strange behavior in the created view.
Is this a View or a Civicrm related bug? And how to solve this?

Comments

dawehner’s picture

Component: fieldapi data » Code

Mh that's hard to say but the issue submission guidelines says that you should first fill it against other projects.

Sadly i have no idea which project is civicrm on drupal.org

Anonymous’s picture

http://civicrm.org/
A crm full integrated in drupal.

I will make an issue there also

dawehner’s picture

Well but they don't have a project on drupal.org?

Anonymous’s picture

http://drupal.org/project/civicrm : not difficult to find, also some related projects.

On drupal.org sinds 2005, with a d4.7 version. Last version d7. CiviCRM is active maintained.

dawehner’s picture

Project: Views (for Drupal 7) » CiviCRM
Version: 7.x-3.0-rc3 » 6.x-1.0

Oh i just sucked to use the project autocompletion.

will_in_wi’s picture

I have this issue as well. I'm using Drupal 7 and the latest stable version of Views and CiviCRM.

ouyang1512’s picture

Me too having this issue

opdavies’s picture

And me.

Using CiviCRM 4.1 and Views 7.x-3.3.

opdavies’s picture

Project: CiviCRM » Views (for Drupal 7)
Version: 6.x-1.0 » 7.x-3.3
Priority: Normal » Major
Status: Active » Patch (to be ported)
StatusFileSize
new816 bytes

This is a bug within the Views module - more specifically within the handlers/views_handler_field.inc file. On line 84, $this->options['group_type'] isn't being set beforehand - hence the error. Attached is a patch that checks to see if this has been set, and if not, set $params to be an empty array - the same as if it was equal to 'group'.

The patch has been created against the Views 7.x-3.3 tag.

opdavies’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new816 bytes

Trying again with the correct status...

Status: Needs review » Needs work

The last submitted patch, views_undefined_index_group_1349546_10.patch, failed testing.

opdavies’s picture

Re-created the patch as per http://drupal.org/node/1054616.

opdavies’s picture

Status: Needs work » Needs review

Changing issue status.

Status: Needs review » Needs work

The last submitted patch, views-undefined_index_group-1349546-12.patch, failed testing.

opdavies’s picture

Status: Needs work » Needs review
StatusFileSize
new816 bytes

Status: Needs review » Needs work

The last submitted patch, views-undefined_index_group-1349546-15.patch, failed testing.

opdavies’s picture

Can anyone give me any advice as to why my patches keep failing?

jthorson’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
jthorson’s picture

Status: Needs work » Needs review

Kicking bot

jthorson’s picture

RichardLynch’s picture

opdavies’s picture

a) Is there any way to get this thread cleaned up - i.e. remove the duplicate patches.
b) What needs to happen to get this committed into Views?

tim.plunkett’s picture

Priority: Major » Normal
Status: Needs review » Postponed (maintainer needs more info)

'group_type' is given a default value here: http://drupalcode.org/project/views.git/blob/refs/heads/7.x-3.x:/include...

Are you sure that it's not coming from a custom handler? Can you paste (http://paste.pocoo.org/) the exported view?

Anonymous’s picture

Patch #15 worked for me, the Notice: Undefined index is gone.
Thanks.

vaccinemedia’s picture

Upgraded to latest dev version of Views and applied the patch ok but error remains with me. 4 errors but on a different line number. With me it is on line 92.

EDIT!:I edited the view and after submitting / saving it the error has disappeared. :)

joemaine’s picture

I installed the latest dev version and tried editing/saving hoping that would solve the problem - I'm still receiving multiple notices for each view...just on a new line (used to be line 84):

Notice: Undefined index: group_type in views_handler_field->query() (line 99 of C:\wamp\www\sites\all\modules\views\handlers\views_handler_field.inc).

Views without CiviCRM fields (currently) are not throwing notices/warnings/errors.

joemaine’s picture

...applied patch #15 to the dev version of Views (note a different line -99- in the patch)...and all is good (for now)

jsimonis’s picture

I'm getting these errors as well. I can apply the patch, but the next update that gets made to Views will just override that patch. Is there any info on when this issue will be fixed in the module?

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

I changed the status to ratbtc.
Please apply patch #15 in the next release.

dawehner’s picture

Status: Reviewed & tested by the community » Needs work

@cmseasy
So can you explain why this is actually happening, see http://drupal.org/node/1349546#comment-5797064

stella’s picture

Running into the same problem. Views config exported to http://pastebin.com/ZVMxx83T

From looking at the CiviCRM field handler option_definition() it seems to implement it correctly (and does

$options = parent::option_definition()

. It doesn't modify the 'group_type' element and that is still set to 'group' in the returned array. I'll try to investigate further, but not sure where to look.

stella’s picture

Status: Needs work » Fixed
StatusFileSize
new6.75 KB

Found the problem. It's a civicrm issue. The civicrm_handler_field_location handler had an instance of function construct() {...} but didn't include the line parent::construct();. Adding this line in fixed the problem for me. I also found similar issues in other handlers. I've attached the patch here just as a FYI. Will post the link to the CiviCRM issue once I figure out how to upload a patch there.

stella’s picture

Status: Fixed » Closed (fixed)

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