modxcms / fred

The friendly front-end editor for visual, drag-and-drop content building in MODX CMS
https://fred.modx.com
MIT License
59 stars 25 forks source link

Can't save the element #366

Closed esshevelev closed 4 years ago

esshevelev commented 4 years ago

After uploading the site from local hosting to virtual, the elements ceased to be saved. Moreover, existing elements can be edited and saved, but no new ones. I fill in the fields, click the "Save" button and nothing happens. There is no new item in the list. New MODX resources are created without problems. On a local hosting, everything works well. What could be the problem?

Error log:

INSERT INTO mysite_fred_elements (name, uuid, description, image, category, rank, option_set, options_override, content) VALUES ('Evgeniy Shevelev', 'f9d29f6e-e997-4f57-88cd-90a816049a62', '', 'https://via.placeholder.com/300x150?text=Evgeniy+Shevelev', 2, 10, 0, '', '') Array ( [0] => 23000 [1] => 1062 [2] => Duplicate entry '0' for key 'PRIMARY' )

matdave commented 4 years ago

It sounds like you had an error in your migration. Check the table mysite_fred_elements structure. It should have an id column that is set to a unique primary key, not null and auto-incremented. If this not there then or set improperly, you have something that failed with your install.

I rechecked the data model for Fred and it is correct, so it is likely just something that blipped depending on your process for migrating / setting up your remote site.