Skip to content

Error saving entries with assets #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nguyenminhcan opened this issue Apr 10, 2025 · 9 comments
Open

Error saving entries with assets #340

nguyenminhcan opened this issue Apr 10, 2025 · 9 comments

Comments

@nguyenminhcan
Copy link

Describe the bug

We get an SQL error when attempting to save entries that use assets within Vizy fields.

The SQL being executed was: INSERT INTO `relations```

CraftCMS: 4.14.14
Vizy: 2.1.22
PHP version: 8.3



### Steps to reproduce

1. Create an Asset field
2. Create Vizy field contained Asset field
3. Create a section and add new field into 
4. Create/Edit an entry on new section with asset filled

<img width="2001" alt="Image" src="https://github.com/user-attachments/assets/8b6084c4-dbb3-4a42-b308-73f3c34f4334" />
Test field with Asset in content

<img width="2029" alt="Image" src="https://github.com/user-attachments/assets/6d31a7e7-387b-4b94-baba-7702a5ad1be4" />
Test section with new test field

### Craft CMS version

4.14.14

### Plugin version

2.1.22

### Multi-site?

Yes

### Additional context

The cause of issue may related with new update on Craft: https://github.com/craftcms/cms/commit/e485b090749b34c125210697c528225424cf23b1 
@OscarBarrett
Copy link

Related: craftcms/cms#17050

@leighgibbo
Copy link

leighgibbo commented Apr 11, 2025

We are also affected as of this morning, as we had to upgrade CraftCMS to 4.14.15 to resolve the recent critical update.

(Edit to provide context):
Confirm we updated from a version below 4.14.14 to the latest version above this morning, when this started happening.

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'sourceId' cannot be null
The SQL being executed was: INSERT INTO `craft_relations` (`fieldId`, `sourceId`, `sourceSiteId`, `targetId`, `sortOrder`, `dateCreated`, `dateUpdated`, `uid`) VALUES (149, NULL, NULL, 177804, 1, '2025-04-11 01:28:04', '2025-04-11 01:28:04', '23b07ba0-91a9-4367-911f-246ff6e5ab3e')

@david-garcia-jr
Copy link

Same here, we downgraded incrementally down to 4.14.11.1 and can confirm it started @ 4.14.12.

craftcms/cms#17050

@engram-design
Copy link
Member

Indeed related to craftcms/cms@e485b09.

Fixed for the next release. To get this early, run composer require verbb/vizy:"dev-craft-4 as 2.1.25".

@bleepsandblops
Copy link

@engram-design is that bug just affecting craft 4, not craft 5?

@engram-design
Copy link
Member

So far, yes @bleepsandblops the change (craftcms/cms@e485b09) doesn't look to have been merged in for Craft 5, but I'll keep an eye on it.

@jan-dh
Copy link

jan-dh commented Apr 15, 2025

I've used the composer require verbb/vizy:"dev-craft-4 as 2.1.25" but now I'm unable to upload any assets within Craft 😢

@engram-design
Copy link
Member

I don't think that'll be related to Vizy, but happy to investigate further - but it's not something I can replicate immediately.

@jan-dh
Copy link

jan-dh commented Apr 17, 2025

Issue went away after admin panel cache clear; this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants