OctoberCMS - Builder Plugin: Prevent The Partial From Being Called If The Current Record Has Not Yet Been Created
I use the builder plugin and a partial in it. If I enter data in the partial without saving the actual record first, I get an sql error (SQLState : Integrity violation constraint: 1048 column 'item_id' cannot be null...).
How can I let the partial check if the corresponding record is already there? (or how can I prevent the partial from being called if the current record has not yet been created, i.e. saved?).
Supplementary information: The attached pictures illustrate the basic problem.
Then I create the required relationships etc. on the code level. Finally I can access the partial in my new plugin.
And this is where the problem arises. I must first create the record under General (i.e. enter data there and click on Save.). Otherwise I get the above error message.
I'm looking for an option, which checks whether the click on Create Translations first checks whether the corresponding record already exists.
The problem is solved.
The reason for the Integrity violation constraint was that the foreign key to the item ID (item table) must be nullable in the translation table.
However, this results in the problem that an item can be created with a translation but without the corresponding item data.
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → OctoberCMS Fileupload completely destroys my backend
- → Page URLs not working
- → Sublime text autocompletion for Laravel
- → OctoberCMS: How to extend a controller by adding or editing RelationController?
- → OctoberCMS error in frontend - frontend is not accessible firing error "Default value for parameters with a class type hint can only be NULL"
- → October CMS - SQL request incompatible with sql_mode=only_full_group_by
- → OctoberCMS call another plugin's data in current plugin's dropdown
- → Get combined post from different categories using OctoberCMS RainLab Blog
- → How is possible to open website inside facebook mobile app like buzzfeed?
- → debugbar and sweetalert plugins incompatibility issue
- → Change all translations inputs together
- → October CMS AJAX actions - plugin