Notice: Undefined index: party_attaching_party in views_natural_sort_get_supported_entity_properties() (line 333 of /sites/all/modules/views_natural_sort/views_natural_sort.module).

Solved by change line 333 of views_natural_sort.module to:

 if (isset($property_info['schema field']['type']) && $schema['fields'][$property_info['schema field']]['type'] != 'varchar') {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lionguard created an issue. See original summary.

lionguard’s picture

Issue summary: View changes
lionguard’s picture

I created a patch file which solves this notice as well as some other notice/warnings due to unset variables
These might be PHP 5.6+ only issues btw

generalredneck’s picture

@lionguard

Thanks for the patch. For future reference, there is an approved workflow for patches using git. If you don't have git, (or did like you did and happened to have 2 copies of the same module), consider still using the patch name format of [project_name]-[short-description]-[issue-number]-[comment-number].patch.

For those who work on sites professionally, this does a lot for documenting where to find updated information on patches in our drush make files, composer.json, PATCHES folder, or PATCHES.TXT, as that format gives us specifically the issue number and comment number.

Thank you for keeping the patch in a -p1 format as well. That helped out a lot.

Lastly, When you submit a patch, move the issue to "needs review" if possible.

With all that said, the real problem here was there is an array_merge above. it was clobbering the existing property values with what was supposed to be the property defaults. So in this case... every $property_info['type'] was "text". Since it was overloading party module's property info type (which was "party") with text, we were making it down to the next line where we were trying to get info from the "User" table for the schema field "party_attaching_party". Clearly it does not have that field because the "Party" type property is handled differently.

You will want to undo your patch on your local code as views natural sort will most likely not be working for you at all.

Test out the patch I worked up and let me know if it gets rid of your notices.

Status: Needs review » Needs work

  • generalredneck committed f659a06 on 7.x-2.x
    Issue #2667926 by generalredneck, lionguard: Incompatibility with Party...
generalredneck’s picture

Status: Needs work » Fixed

went ahead and committed this one. give me a heads up if you see anything else. specific to the error "Notice: Undefined index: party_attaching_party in views_natural_sort_get_supported_entity_properties()"

duckydan’s picture

Never mind.

generalredneck’s picture

You should also get the fix in 2.2. Shouldn't need the development release.
screeny

duckydan’s picture

Understood. I thought the error I had went away but it did not. My mistake.

I am getting this:

Notice: Undefined index: vuuid in views_natural_sort_get_supported_entity_properties() (line 333 of /var/www/blog/sites/all/modules/views_natural_sort/views_natural_sort.module).

But I have not looked deeply into. I was going to add in an isset in there somewhere before line 333 to see if I could take care of it. Not sure where vuuid is even coming from.

duckydan’s picture

Also seeing this:

Notice: Undefined property: stdClass::$name in views_natural_sort_entity_to_vns() (line 405 of /var/www/blog/sites/all/modules/views_natural_sort/views_natural_sort.module).

Again, not sure where from.

generalredneck’s picture

Can you please create separate issues for your new notices? you are starting to use this issue as a catch all for notices and the point was to look into the party module.

We can follow up on additional questions in the repective issues for #10 & #11 since it's clearly a different module causing the behavior. Specifically for #10... one that produces a entity with vuuid.

Appreciate it tons.

duckydan’s picture

Will do.

Status: Fixed » Closed (fixed)

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