-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[BUG] Click "New Draft" cause error UNIQUE constraint failed: cms_pagecontent.language, cms_pagecontent.page_id #7732
Comments
@TLuesebrinck I am afraid, so far, I cannot reproduce the error. Do you remember how you got your db into this state? Have you fully run djangocms-versioning's migrations? It should have removed the uniqueness constraints for PageContent. I have had issues when adding versioning to the project, removing it, making changes, and adding versioning back again. I am not sure if these are the same. Did you add or remove djangocms-versionging temporarily? |
I followed the manual "Installing django CMS by hand" and the step "djangocms myproject" should do all the steps to run the project. But after some problems occurred, I checked the migrations, and it seems this step was not completed. I had to call makemigrations then migrate. I am not 100% sure, but it could be possible that I create a page and check the migration later. |
Now, that you ran the migrations, can you create a new draft? |
No, I cant create a new draft
I am not sure if I got the success message. Maybe I start the project by pressing F5 or so.
I remeber I created a page and then close the project and the next day it started with a 404 message (what it still do).
I open the admin view by manual enter /admin/. My idea was with no published page I get an 404.
I dont remeber the order of all my steps. But I am sure I start the project created a page and later after the problems I checked the install and excuted the makemigrations command.
…________________________________
Von: Fabian Braun ***@***.***>
Gesendet: Donnerstag, 4. Januar 2024 11:18
An: django-cms/django-cms ***@***.***>
Cc: TLuesebrinck ***@***.***>; Mention ***@***.***>
Betreff: Re: [django-cms/django-cms] [BUG] Click "New Draft" cause error UNIQUE constraint failed: cms_pagecontent.language, cms_pagecontent.page_id (Issue #7732)
djangocms should actually settle everything for you in the sqlite database it uses. If the djangocms command had failed, it would have done so with an error message. Upon success it prints a success message - something like
Check installation
python -m manage cms check
***************************************
django CMS 4.1.0 installed successfully
***************************************
Congratulations! You have successfully installed django CMS,
the lean enterprise content management powered by Django!
Now, to start the development server first go to your newly
created project and then call the runserver management command:
$ cd /Users/fsbraun/my-project/newproject
$ python -m manage runserver
Learn more at https://docs.django-cms.org/
Join the django CMS Slack channel http://www.django-cms.org/slack
Enjoy!
Now, that you ran the migrations, can you create a new draft?
—
Reply to this email directly, view it on GitHub<#7732 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWMV5NQ2MJJISE4EH2XAYHDYMZ6XFAVCNFSM6AAAAABBLVXSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWHA2DKMRUG4>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
One more idea comes to my mind, but I am medium-optimistic it will work. Can you try:
Please let me know if the command returns any fixes. If that does not help, I'd be happy to schedule a google meet and try to debug. Alternatively, you could share your database |
the install do not seams to install anything "new"
And python -m manage create_versions
output this:
Unknown command: 'create_versions'. Did you mean clearsessions?
Type 'manage.py help' for usage.
…________________________________
Von: Fabian Braun ***@***.***>
Gesendet: Donnerstag, 4. Januar 2024 12:18
An: django-cms/django-cms ***@***.***>
Cc: TLuesebrinck ***@***.***>; Mention ***@***.***>
Betreff: Re: [django-cms/django-cms] [BUG] Click "New Draft" cause error UNIQUE constraint failed: cms_pagecontent.language, cms_pagecontent.page_id (Issue #7732)
One more idea comes to my mind, but I am medium-optimistic it will work. Can you try:
1. cd into the folder which contains your virtual environment
2. $ pip install git+https://github.com/django-cms/djangocms-versioning
3. cd into the project folder
4. $ python -m manage create_versions
Please let me know if the command returns any fixes.
If that does not help, I'd be happy to schedule a google meet and try to debug. Alternatively, you could share your database db.sqlite3 privately, so we can get a grip of what has happened.
—
Reply to this email directly, view it on GitHub<#7732 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWMV5NW64PRS24DN4Y3LNQLYM2FW3AVCNFSM6AAAAABBLVXSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWHEZDOMZUGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Try uninstalling djangocms-versioning first, then. |
right I forgot that.
python -m manage create_versions
0 objects of type AliasContent, thereof 0 missing Version object
4 objects of type PageContent, thereof 0 missing Version object
But the problem still exists.
…________________________________
Von: Fabian Braun ***@***.***>
Gesendet: Donnerstag, 4. Januar 2024 12:30
An: django-cms/django-cms ***@***.***>
Cc: TLuesebrinck ***@***.***>; Mention ***@***.***>
Betreff: Re: [django-cms/django-cms] [BUG] Click "New Draft" cause error UNIQUE constraint failed: cms_pagecontent.language, cms_pagecontent.page_id (Issue #7732)
Try uninstalling djangocms-versioning first, then.
—
Reply to this email directly, view it on GitHub<#7732 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWMV5NUZGUWCC7PVRNF4FNTYM2HEZAVCNFSM6AAAAABBLVXSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWHE2DENJTHA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The output is correct. The last resort will be to delete the |
After rebuild the DB it works now.
Some issues I found, they are not specific for version 4 :
What I found confusing is the fact that if the project has no published page, it opens with a 404. Although I understand the reason behind this occurrence, a novice may perceive it as a malfunction. Enter "admin" by hand in the URL and publish the root page to fix this is a difficult task.
The frontend comes with Bootstrap 5.2.1 (from september 2022) the current version is 5.3.2 ( it require some template changes becuase of the improved dark mode behaviour)
In dark mode the admin messages like "published a page" are hard to read (dark color text on black background). I also think that the messages are not noticeable enough and disappear too quickly. Specially error messages disappear before I had a chance to read them.
The responsive settings (frontend row, and column ) are still a mess. The label text overwrite often the input and makes it unredable. The fields are type number but "col-auto" is also an important option.
I would like to navigate the plugins with the cursor keys through the tree levels. When the design gets complex its hard to hit the right point with the mouse. Sometimes the entire tree scroll out of the viewport.
I found this overlapping text in the admin. Page settings of a published page.
[cid:5436552a-834a-493c-9845-9831891581cb]
Its caused by this css class:
form .aligned label+div.readonly {
margin-top:-30px;
}
…________________________________
Von: Fabian Braun ***@***.***>
Gesendet: Donnerstag, 4. Januar 2024 12:37
An: django-cms/django-cms ***@***.***>
Cc: TLuesebrinck ***@***.***>; Mention ***@***.***>
Betreff: Re: [django-cms/django-cms] [BUG] Click "New Draft" cause error UNIQUE constraint failed: cms_pagecontent.language, cms_pagecontent.page_id (Issue #7732)
The last resort will be to delete the db.sqlite3 file and run migrations and createsuperuser again to see if the bug appears once more. If so, please try reporting the exact steps you took.
—
Reply to this email directly, view it on GitHub<#7732 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWMV5NXBWGPBNLAUR7UOIFTYM2H5ZAVCNFSM6AAAAABBLVXSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWHE2TGMZWGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you, @TLuesebrinck ! Those are valuable inputs. Thank you very much! A few quick comments:
|
Regarding the plugin tree. I know the function of the shift key,
it helps to find a plugin. But this does not help if I want to move the
plugin in a new place. I would like to mark a plugin press and hold a key
and move it through the tree level with the cursor keys instead with the
mouse. Move a plugin in the tree level one level up/down is often
difficult, the spot you have to hit is very small. Clicking the Hamburger
icon of the plugin and movie the mouse a little bit can scroll the complete
tree out of the view, and you lost the orientation.
Am Do., 4. Jan. 2024 um 22:39 Uhr schrieb Fabian Braun <
***@***.***>:
… Thank you, @TLuesebrinck <https://github.com/TLuesebrinck> ! Those are
valuable inputs. Thank you very much! A few quick comments:
- If no root page exists, the "create" wizard is opened automatically
to allow a new user to create a page. An existing, but unpublished page
leads to the 404 error. A redirect in the latter case would not allow for
an unpublished root page.
- The next release of djangocms-frontend will by default retrieve
bootstrap 5.3.x from a CDN. This is for convenience only, and developers
are strongly encouraged to create their own base template, providing their
preferred style sheets.
- *Can you open a separate issue for the message colours and duration*?
- If've been thinking to remove the labels from the row and col fields
in djangocms-frontend - they are redundant and only meant to help navigate
(am I filling the correct field?). A decision has not been made. When
looking at it, I realize those fields are harder to read in dark mode. In
light mode, I personally do not find them distracting.
- You get auto entries
<https://djangocms-frontend.readthedocs.io/en/latest/grid.html#column>
by typing "0" (or using the arrows).
- To navigate the plugin tree, holding the shift key can be helpful.
When hovering plugins on the page, their entry in the structure board will
highlight and vice versa. For me, this is often the easiest way to find
plugins in the tree.
- Overlapping read-only fields in the admin are due to changes in
Django 4.2+'s admin CSS. This is fixed in djangocms-admin-style 3.2.7 due
any day now.
—
Reply to this email directly, view it on GitHub
<#7732 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWMV5NWUUXFNQ2PRJKZZZQLYM4OSZAVCNFSM6AAAAABBLVXSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZXG44TMOJUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Click "New Draft" cause error UNIQUE constraint failed: cms_pagecontent.language, cms_pagecontent.page_id
The text was updated successfully, but these errors were encountered: