Jump to content

You must save Fieldgroup 'MarkupCSScompress' before adding to Template 'MarkupCSScompress'


Recommended Posts

Somehow it's solved... I don't know how it happend. Sorry for your time!

I think the Fieldgroup already existed and I tried to create another one with the same name. 

Deleting the fieldgroup belonging to the template in the DB did solve the issue. ( I also deleted fieldgroups_fields with the corresponding fieldgroups_id )

Couldn't find any topic / tutorial or docu on how to do this with the api:

$fieldgroups = wire("fieldgroups"); // don't know if $fieldgroups is direct accesable in the templates
$template = $templates->get("a-template");
$fieldgroupId = (int) $template->fields->id;
$fieldgroup = $fieldgroups->get($fieldgroupId);
$templates->delete($template)
$fieldgroups->delete($fieldgroup);
Edited by martijn-geerts
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...