Call to a member function getString() on null in Drupal\business_rules\Plugin\EntityReferenceSelection\BusinessRulesViewsSelection->getParentFieldValue() (line 511)

After further investigation I came to a conclusion that after applying a patch for #1699378: Allow tokens in entity reference views selection arguments the behavior of line 511 changed. I am still investigating like what exactly happened But on the other side if a condition is applied to the code line 511 it serves the purpose and works like a charm with the above core patch.

Please find attached a patch file to fix this bug caused by core patch.

Comments

Qandeel created an issue. See original summary.

qandeel’s picture

StatusFileSize
new868 bytes
qandeel’s picture

StatusFileSize
new868 bytes
qandeel’s picture

kdomenick’s picture

Patch in #3 worked for me!

THANK YOU for this post! I have been struggling with this same issue (unable to edit fields), but I couldn't identify when it began and what was causing it. I knew that I was able to edit these fields at one time, so it didn't feel like a bug with Business Rules.

My /core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php has been patched/customized also.

colan’s picture

Title: After applying Core Patch, I started getting errors when editing a dependent field » Dynamic Views Arguments via Tokens patch causes "Call to a member function getString() on null"
Version: 8.x-1.0-beta7 » 8.x-1.x-dev
Issue summary: View changes
Status: Active » Needs review
Related issues: +#1699378: Allow tokens in entity reference views selection arguments
StatusFileSize
new1.24 KB

This bug still exists in HEAD.

We can fix this in one line; there's no need for the additional ones.

  • colan committed 0473597 on 8.x-1.x authored by Qandeel
    Issue #3051064 by Qandeel, colan: Ensure field exists before getting it.
    
colan’s picture

Status: Needs review » Fixed

Thanks for finding and working on this one.

Status: Fixed » Closed (fixed)

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