Skip to content
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

Throws an error when saving on new entries #3

Open
mijewe opened this issue Jan 27, 2021 · 1 comment
Open

Throws an error when saving on new entries #3

mijewe opened this issue Jan 27, 2021 · 1 comment

Comments

@mijewe
Copy link

mijewe commented Jan 27, 2021

The password saving works well on existing entries, but when saving new entries I get the following error:

Integrity constraint violation – yii\db\IntegrityException
SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘entryId’ cannot be null
The SQL being executed was: INSERT INTO `craft_imarc_password_protection_record` (`entryId`, `passwordProtectionEnabled`, `password`, `dateCreated`, `uid`, `dateUpdated`) VALUES (NULL, 0, ‘’, ‘2021-01-27 16:43:15’, ‘a510e6f6-d7ce-4e90-8615-9c1feb8a0dea’, ‘2021-01-27 16:43:15’)
Error Info: Array
(
    [0] => 23000
    [1] => 1048
    [2] => Column ‘entryId’ cannot be null
)
↵
Caused by: PDOException
SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘entryId’ cannot be null
in /vendor/yiisoft/yii2/db/Command.php at line 1290

It looks like the entryId doesn't exist at this point.

This is on Craft 3.1.34.3

@jannisborgers
Copy link

I installed the plugin midway through development.

When activated, existing entries cannot be saved anymore, no matter if the „Enable Lock Screen“ toggle is active or inactive or a password has been set. I get the same error message that @mijewe pasted above.

On new entries, the initial save is successful, but opening the entry afterwards shows that the toggle has been moved back to inactive. After this, the same error occurs on save like other existing entries.

Only way is to deactivate/uninstall the plugin.

Craft is on version 3.5.17.1

pedroacacio pushed a commit to pedroacacio/craft-password-protection that referenced this issue Sep 20, 2023
Fix the load bug in the CP and Front-end
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

2 participants