SQL error when deleting a site
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 705
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 134
Description
Description
I get this error when deleting a site
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'primary' cannot be null
The SQL being executed was: UPDATE `craft_sites` SET `groupId`=1, `primary`=NULL, `name`=NULL, `handle`=NULL, `language`=NULL, `hasUrls`=NULL, `baseUrl`=NULL, `sortOrder`=NULL, `dateUpdated`='2020-05-19 11:46:05' WHERE `id`=6
Additional info
- Craft version:3.4.18
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report concerns deleting site 6 and shows an UPDATE against the craft_sites table that sets primary and other fields to NULL. Start by reproducing site deletion on Craft 3.4.18 and tracing the deletion path that issues this update. Done means deleting a site no longer raises the reported integrity-constraint error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, sql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100