Trying to filter one (of two) Express Details Blocks on the same page as an Express List Block filtering it, getID() on null

So this is “working” in Dev but somehow “broken” in Prod, and I can’t yet figure out why. Both running Concrete CMS v8.5.19.

On each sample page, I have three Blocks.

  1. Block A: Express Details Block, (which is not filtered by another block, it’s displaying an Express Entry from an attribute on the page, and successfully shows the details for that Express Entry).
  2. Block B: Express Details Block, this block filters for a particular Express Entity “from another page”.
  3. Block C: Express List Block, which shows the Express Entries for the Express Entity that Block B is using.

All three of these Blocks are on the same page.

When I click on an Entry in Block C to filter Block B, I get the following error output:

“Call to a member function getID() on null”

Referring to: “updates/concrete-cms-8.5.19/concrete/blocks/express_entry_detail/controller.php” - line 118

Which is called from: “updates/concrete-cms-8.5.19/concrete/src/Controller/AbstractController.php” - line 315

====

Now the thing is when I REMOVE Block A from that page… Block B correctly shows the details of the selected Express Entry that Block C selected when I clicked on it.

===

Again, this WORKS (as in does not throw an error) in Dev, but not in Prod.

Anyone have any ideas why this is happening? And yes, this happens when all of the Blocks in Prod are stock (zero templating/themeing).

Does anyone have any idea what I can do about this? I still don’t know why this is even happening let alone know what options I have. :confused:

What’s the difference in the body of the prod and dev POST requests?

1 Like

I’m not entirely sure how to check that, can you recommend a method? I’m not exactly a Dev by trade for this, more one of necessity, so I’m still green behind the ears in many areas :stuck_out_tongue:

I usually use the network tab of the developer console of the browser to inspect the request. You should be able to see exactly what the browser is posting to the prod and dev servers and compare.

I get an HTTP 500, and it’s mentioning Referrer Policy strict-origin-when-cross-origin but I can’t see why that’s happening on my Prod vs Dev.

HTTP 500 is pretty generic, but there should be some web server logs to give further details

Apache logs only report an HTTP 500 code. I just reproduced the issue and that’s all the showed. So yeah not yet seeing where this issue is coming from.

Complete shot in the dark here but I’ve had weird 500 errors show up if I move my .htaccess file from my dev to prod. I’ve had to make these changes to /application/generated_overrides/concrete.php

'seo' => [
    'redirect_to_canonical_url' => false,
    'url_rewriting' => false,

]

and create an entirely blank .htaccess and build it up from there on the server. Again, just a shot in the dark.

I tried replicating those settings (for SEO rewrite/etc) and the .htaccess from the Dev system to Prod just now, cleared cache multiple times, didn’t change results unfortunately. Same error about getID() on null… I’m pretty sure this is something to do with Express as I don’t think .htaccess can influence an error like that, and that is explicitly an Express type error… hmmm…

Oh and to re-iterate, the issue only happens when both Express Details block are on the same page, and each are configured differently. The issue doesn’t come up when only one of each is on said page. And in the end I really do need both on the page anyways so having only one is not an acceptable method.

Thanks for the thoughts but I’m pretty sure the issue is elsewhere… somehow…

Okay so I fiddled with the “First” Express Details Block which pulls an Express Entry ID from an Attribute on the page… turned it from that mode into “use this specific entry ID” on the Page Type Output, then I could select the Express Entry ID with the “Second” Express Details Block… HOWEVER it cleared the Entry ID the “First Express Details Block” so it didn’t show anything…

I then switched the “First” Express Details Block back to pulling the Express Entry ID from teh Attribute on the Page… and now I can’t get it to throw the getID() Null error… HOWEVER when the “Second” Express Details Block shows data, the “First” one is empty as it seems to “forget” the Attribute it’s pulling from, for the page… not yet sure why, but I think this is progress…

Going to fiddle more and this seems a bit like bad cache somewhere that was never getting cleared because of $reasons.

Yeah now I can’t get the “First” Express Details Block to show ANYTHING in ANY scenario where I’m filtering the “Second” Express Details Block by going to the sub-URL …/view_express_entity/### but I AM now seeing the details for the Express Entry ### in the “Second” Express Details Block.

I’ve turned off site-wide caching for all the things, cleared cache, still not getting anything for the “First” Express Details Block.

I checked the Attribute for each page, set correctly, same for the Page Type Form… I don’t see why this is happening but I’m pretty sure this “explains” the getID() being Null error coming up… but does not explain WHY it is null when it shouldn’t be…

@andrew really could use your insights here if possible please.

On detail that just came to mind, unsure if relevant…

On the Dev system the test page is NOT a custom “Page Type”, just a regular new page thing where I did NOT customise the Output.

On the Prod system this is on a custom Page Type that is configured to post under a specific page/section/URL.

Not sure if this has any relevancy.

So am I on my own then?

So I added some debug to the express_entry_detail block that is not showing data, and the $entry value is being set to NULL when the other Express Entry Detail block is being filtered by going to the sub-URL /view_express_entity/###

Why is this being set to null? This shouldn’t be set to null as it’s supposed to be pulling from the page attribute…

And again it is NOT doing the NULL effect on the Dev site. The same debug code not only shows the content but also outputs it is NOT NULL.

I still don’t see why…

Okay so I tested another scenario. I added ANOTHER Express Entry Detail block to the page (so now three) except this one I pointed ONLY to the Express Entry that’s relevant to that page, and NOT pulling from the Page Attribute.

So this might be something specific to that Express Object as to why the $entry value for the express_entry_detail block is being nulled out… This still doesn’t make any sense

I truly cannot see how I can help myself here. PLEASE I NEED HELP.

I compared the relevant Express Object between Dev and Prod side by side and could not find ANYTHING different between them. I even turned on dashboard re-ordering of entries, forcefully re-ordered some entries, and that changed nothing.

When I try to reproduce this issue on a completely different page, that isn’t a custom page type, I get the “Call to a member function getID() on null” error again referering to this:

Error
…/blocks/express_entry_detail/controller.php118

Which refers to this line of code:

“if ($entry->getEntity()->getID() == $entity->getID()) {”

Now I can’t tell WHICH getID() is null or what but clearly this problem isn’t isolated to that page, which I’m pretty sure I proved earlier.

WHY IS THIS GETTING NULLED???