I am getting
Fatal error: Unsupported operand types in EntityPager.php on line 38
I am using bootstrap theme and Drupal 8.3.6 and 8.x-1.0-alpha2 version

Just tried with the latest development version (8.x-1.x-dev updated 13 Jul 2017) and now I get
Fatal error: Call to a member function getEntityTypeId() on null in C:\wamp64\www\modules\entity_pager\src\EntityPager.php on line 238
I am adding the entity pager example block to the 'Content' region

Any solution?

Comments

r4arnys created an issue. See original summary.

r4arnys’s picture

Issue summary: View changes
znak’s picture

Assigned: r4arnys » Unassigned
Status: Active » Needs review
StatusFileSize
new609 bytes

Maybe this patch can help you?

replicaobscura’s picture

This patch seems to make sense to me. Is anyone else seeing this issue? I'm curious why there would not be an entity available that causes us to even have to check to make sure we can get an entity type ID. Definitely not opposed to the fix in the patch, but wondering if a change somewhere else might also make sense to prevent a scenario where there's no entity available to the class.

I'll test this patch and we can at least get this fix in ASAP.

maaty388’s picture

Status: Needs review » Active

Hi,
For me, this patch is not working.

maaty388’s picture

Status: Active » Needs review
StatusFileSize
new641 bytes

Fixed this error

Fatal error: Unsupported operand types in EntityPager.php on line 38
I am using bootstrap theme and Drupal 8.3.6 and 8.x-1.0-alpha2 version

Second one is still not working for me please review my patch and possibly fix second error.

BarisW’s picture

Version: 8.x-1.0-alpha2 » 8.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

Thanks! Had the same issue, and the patch solved the problem.

firfin’s picture

StatusFileSize
new630 bytes

I had the same issue using drupal 8.4 and enitity pager 8.x-1.0-alpha2
Patch in #6 solved it. I second RTBC and made patch compatible with drupal coding standards. Specifically
https://www.drupal.org/docs/develop/standards/coding-standards#indenting and https://www.drupal.org/docs/develop/standards/coding-standards#controlst...

firfin’s picture

Status: Reviewed & tested by the community » Needs review
maaty388’s picture

Okay, thank you for code fix standards...

BarisW’s picture

Eh, you patch is basically a revert of #6? Are you sure you uploaded the correct patch?

firfin’s picture

StatusFileSize
new629 bytes

Wow, you are absolutely right BarisW.
My bad, correct patch attached now.

johnhanley’s picture

+1 for patch #12. Thanks.

firfin’s picture

Status: Needs review » Reviewed & tested by the community
firfin’s picture

Why is the testbot not running this?

maaty388’s picture

It didn't even run any of the previous patches. And I went really fast through other issues and testbot didn't run them.

  • bmcclure committed 8839137 on 8.x-1.x authored by firfin
    Issue #2900996 by firfin, matjaz_zavski, Znak: Fatal Error
    
  • bmcclure committed 9a0a2d7 on 8.x-1.x
    Issue #2900996 by firfin, matjaz_zavski, Znak, bmcclure: Fatal Error
    
replicaobscura’s picture

Assigned: Unassigned » replicaobscura
Priority: Critical » Major
Status: Reviewed & tested by the community » Fixed

Thanks all!

I made two commits. The first was a slight refactoring of the latest RTBC patch. The second is adding an extra safeguard in place in the detokenize() function to make sure we have a valid entity.

I'll make a new release of Entity Pager soon to include these changes, but they're on dev now. Thanks again for the community effort here!

  • bmcclure committed 637357c on 8.x-1.x
    Issue #2900996 by bmcclure: Fatal Error followup fix
    
firfin’s picture

Newest dev works for me, thanks!
A new release would be nice to have, yeah!

Status: Fixed » Closed (fixed)

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