LAPS Posted November 1, 2018 Share Posted November 1, 2018 In particular, I'm developing a new module that creates a copy of the user template and keeps that copy updated as regards the fields. I think, the module needs these things: a ___install() method that creates a new custom template copying the fields (with contexts/settings) of the user template. a hook method (maybe stated in ready()) that checks if the user template has been updated and if so updates the custom template accordingly so to have the same fields in both user and custom templates. How can I make? Link to comment Share on other sites More sharing options...
Robin S Posted November 2, 2018 Share Posted November 2, 2018 2 hours ago, LAPS said: I'm developing a new module that creates a copy of the user template and keeps that copy updated as regards the fields. Instead of doing this, try the following instead: 1. In /site/config.php set $config->advanced = true; 2. Create your user_copy template (whatever you want to call it) 3. On the "Basics" tab of Edit Template, select "user" for "Fieldgroup" and save. 4. Remove the line you added in step 1. Now the user_copy template will always have the same fields as the user template. 1 Link to comment Share on other sites More sharing options...
LAPS Posted November 2, 2018 Author Share Posted November 2, 2018 On step 3, when I select "user" for "Fieldgroup" and save, then I get this error message: Quote Fieldgroup for template 'user_copy' may not be changed because it has permanent fields. Link to comment Share on other sites More sharing options...
Robin S Posted November 2, 2018 Share Posted November 2, 2018 user_copy should be a new template without any fields already added to it. The only field it should contain is the automatic Title field which is not a permanent field unless you manually changed it to be permanent. Link to comment Share on other sites More sharing options...
LAPS Posted November 2, 2018 Author Share Posted November 2, 2018 When I manage to remove the 'pass', 'email', 'roles', and 'language' fields of the user_copy template and save then I get this error message: Quote Field 'pass'/'email'/'roles'/'language' may not be removed from fieldgroup '' because it is permanent (Field::flagPermanent). Save of fieldgroup changes aborted. The only field I have been able to remove was the 'admin_theme'. Link to comment Share on other sites More sharing options...
LAPS Posted November 2, 2018 Author Share Posted November 2, 2018 To remove the 'pass', 'email', 'roles', and 'language' fields from the user_copy template, I had to temporarily disable their "system" and "permanent" statuses for each field by unchecking the related options in the Advanced tab of Edit Field. After this, I was able to complete the step 3 successfully. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now