Hello,
I'm getting the following error:
Too few arguments to function entity_property_verbatim_get(), 3 passed in /usr/share/nginx/html/drupal/sites/all/modules/entity/includes/entity.property.inc on line 600 and exactly 5 expected in entity_property_verbatim_get() (line 376 of /usr/share/nginx/html/drupal/sites/all/modules/entity/includes/entity.property.inc)

System is Ubuntu 18.04
php 7.2
DB MAriaDB
Drupal 7.61
entity mod. 7.x-1.9

I've recently updated the system to Ubuntu 18.04 and php7.2. After a quick check, except some warning, I didn't note anything wrong, but today an user told me that he wasn't able to see his new created posts, and then I found out that as administrator, I can't delete any content created by others. I've rebuilt the permissions, cleared the cache but nothing. When I try to delete a content, I get "The website encountered an unexpected error. Please try again later." I can add that I've the rules module installed: when I delete a post, a rule is fired with success, but the content is still there!
Since the above error about entity is the only serious one, I suppose it could be the cause of my problem, but I'm not sure and I don't have any clue about how to solve it...

Thank you
Kinmen

Comments

kinmen created an issue. See original summary.

kinmen’s picture

Status: Active » Closed (won't fix)

I've found out it is probably related to another module.

kscheirer’s picture

Version: 7.x-1.9 » 7.x-1.x-dev
Status: Closed (won't fix) » Active
Issue tags: +PHP 7.0 (duplicate), +php7

This should probably get fixed anyway.

daiwik.addweb’s picture

Status: Active » Needs review
StatusFileSize
new535 bytes

@kinmen, Please find the updated patch, to resolve I've added required arguments on entity_property_verbatim_get function. Hope this will helps.

Thanks

kinmen’s picture

Hello Roshnipatel.addweb. Thank you very much for spending your time to look at my issue. Today I've spent some time in testing your patch, and I can tell you that it works, I just had to clear the cache a couple of times after applying it. Finally the posts of my web site are shown again to everybody, users and visitors!! I therefore could complete the switch from php 7.0 to php 7.2. Hurrah!! I really don't know how to thank you, I've waited so long for a proper solution, wondering why nobody else seemed to experience my same issue... I'll keep an eye in the next days to be sure that everything runs fine.

This is to thank you:) 🌹
Kinmen

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community

Based on #5.

joelpittet’s picture

Issue tags: -PHP 7.0 (duplicate), -php7 +PHP 7.2

Adjusting tags, seems worth a bump too ;)

tr’s picture

Priority: Normal » Minor
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new536 bytes

entity_metadata_verbatim_get() has been deprecated for more than 10 years but still exists as a wrapper around entity_property_verbatim_get() so that anyone still calling the old function will actually be running the new function. Drupal's policy on API changes states we shouldn't make an API change between minor point releases, so removing entity_metadata_verbatim_get() entirely during the D7 lifecycle is not an option.

The problem is that the replacement function entity_property_verbatim_get() has two additional required parameters which the wrapper doesn't know about. More modern versions of PHP will complain that the wrapper is calling entity_property_verbatim_get() with the wrong number of parameters, and that is a valid complaint. We want to be able to use Entity API on more modern versions of PHP, and we want to maintain backwards compatibility as much as possible for the many existing sites that might be calling the old deprecated function.

The patch does this:

 function entity_metadata_verbatim_get($data, array $options, $name) {
-  return entity_property_verbatim_get($data, $options, $name);
+  return entity_property_verbatim_get($data, $options, $name, $type, $info);
 }

While this DOES provide the correct number of parameters to entity_property_verbatim_get(), the last two parameters, $type and $info, are undefined variables so this patch will ALSO generate complaints. Because these are required parameters, I think it's better to pass actual values - NULL instead of $type and array() instead of $info. These are both valid values/types for those parameters, and will not cause any change in operation to entity_property_verbatim_get() or entity_property_verbatim_get().

joseph.olstad’s picture

ya, last two params, pass NULL and array() should be ok.

  • TR committed a71df99 on 7.x-1.x
    Issue #3023044 by TR: error in entity_property_verbatim_get
    
tr’s picture

Status: Needs review » Fixed

Committed #8.

Status: Fixed » Closed (fixed)

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