You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#101630 update JCE profiles via installer or script

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by rusasadmins on Wednesday, 20 November 2019 21:21 GMT

rusasadmins
Hi,
We have a lot of sites and I am trying to figure out how to update profiles without doing it manually on each site.

a) Import JCE Profiles by using a script. I've got one written the inserts the contend of the exported profiles into the wf_profiles table, but it doesn't seem to update the actual profiles. Maybe I missed a part, but would you tell me if editing the entry in wf_profiles should take care of updating profiles? Does the actual profiles XML file need to exist somewhere within the site? I see that sometimes it is saved into tmp but that does not seem consistent across sites.

b) Option B would be to roll our customized JCE Profiles into the installer package. Where do the default profiles exist in the installer?

Any assistance would be appreciated.
Thank you!

Ryan
To import the profile using an exported profile xml file, try using this in your script:

require_once (JPATH_ADMINISTRATOR . '/components/com_jce/helpers/profiles.php');

$result = JceProfilesHelper :: processImport($file); // where $file is the absolute path to the exported xml profile file.

if (!$result) {
    // some error message
}
Please note in the code above I have had to add a space on either side of the :: to prevent this forum's emoji parser from messing with the code.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

rusasadmins
Thank you Ryan. It might also help to know where the "Editor Styles" setting in Global Configuration is stored in the database.

These are the two tables I found that seem like they could hold the setting, but I cannot find it:
j__extensions
j__wf_profiles

Thank you!
Michelle

Ryan
The Global Configuration is stored as a JSON string in the params field of the entry in the #__extensions table with the name plg_editors_jce

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

rusasadmins
There was an error in my script that was preventing profile params from importing. It is working now. 😃

Thank you for your help, Ryan!