Uncaught PHP Exception Drupal\\Core\\Entity\\EntityStorageException: "SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'access' at row 1:

XmlSitemapLinkStorage::create()

When access is not granted (example: user profile view for Anonymous user), the xmlsitemap access is not checked correctly for integer values and entity save will crash.

Also I removed the unnecessary variables $url and $uri

The integer problem is with "status" to, in some cases. So I moved to must check section of the code.
Example: Check user entity at settings and save (but not configure), in this case the user entity is "Excluded" by default and the status is blank. So when type is Excluded status is NULL and save will crash.

patch attached for fix

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

balintcsaba created an issue. See original summary.

balintcsaba’s picture

balintcsaba’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: entity_save_bug-2674764-1.patch, failed testing.

The last submitted patch, 2: entity_save_bug-2674764-1.patch, failed testing.

balintcsaba’s picture

Status: Needs work » Needs review

Since the module test is incorrect I think that the patch is ok so back to needs review aggain.

juampynr’s picture

Status: Needs review » Postponed (maintainer needs more info)

We merged in a bunch of work from @amateescu into the module. Can you re-test please?

amateescu’s picture

Priority: Major » Normal
Status: Postponed (maintainer needs more info) » Needs review
FileSize
1023 bytes

I couldn't get into the situation described in the issue summary, but this can be easily fixed with a simple type cast.

amateescu’s picture

Status: Needs review » Fixed

Committed and pushed to 8.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

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