Creating a new importer throws php warning below, seems like PHP 7.2 compatibility issue

Warning: count(): Parameter must be an array or an object that implements Countable in Drupal\entity_import\Form\EntityImporterOptionsForm->buildForm() (line 106 of /modules/contrib/entity_import/src/Form/EntityImporterOptionsForm.php).

using D8.7.1 with PHP 7.2.10

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

perke created an issue. See original summary.

jigish.addweb’s picture

FileSize
900 bytes

@perke, Please find the below-attached patch, that resolves the above mentioned error.

Thanks

jigish.addweb’s picture

Status: Active » Needs review
perke’s picture

Status: Needs review » Reviewed & tested by the community

Patch tested and works as expected, thanks @jigishaddweb!

perke’s picture

Status: Reviewed & tested by the community » Needs work

hm, I'll have to take that back... I was unable to add unique identifier after applying patch. Clicking the "Add identifier" button just makes the ajax call but does not display the form.

However, on the importer that already had an identifier set, I was able to add another identifier.

Reverting the patch fixed it.

droath’s picture

FileSize
523 bytes

I've looked into the issue, here is a quick code change that should fix the problem you're experiencing.

droath’s picture

Status: Needs work » Needs review
firfin’s picture

Status: Needs review » Reviewed & tested by the community

Works as advertised. Thanks!
Brilliant module, I love it!

  • droath committed 5ea9ebe on 8.x-1.x
    Issue #3053661 by droath, jigish.addweb: Warning: count(): Parameter...
droath’s picture

Status: Reviewed & tested by the community » Fixed

Fixed! Pushed into the latest dev release.

droath’s picture

Status: Fixed » Closed (fixed)