XF 2.3 When/how is code_cache phrase_groups rebuilt?

frm

Well-known member
I did a MySQL query to replace phrases and couldn't seem to figure out why they weren't changing in some places.

I found them hardcoded in /code_cache/phrase_groups l0 and l1.

Removing these folders showed the new phrases done by MySQL edits.

However, there's no more cache for these.

Is this the way to do it? How do I rebuild phrase_groups? Is it better to put l0 and l1 back and then edit the PHP files?

$ php cmd.php xf:rebuild-master-data doesn't seem appropriate here as the phrases were customized. If I run that, wouldn't they revert to the original phrase?
 
Direct database manipulation can cause a lot of problems. You should always make changes from within XF.

If you edit and save one of the phrases in the group from the control panel, it should recompile the cache.
 
Direct database manipulation can cause a lot of problems. You should always make changes from within XF.
Without find & replace, that would've been a daunting 2~ hour task vice 5-10 minutes.
If you edit and save one of the phrases in the group
One phrase out of the group that the add on(s) create?

Should I move l1 back or will it recreate l1 after that? l0 is there as it shows fine then, but l1 was the problematic folder.
 
Without find & replace, that would've been a daunting 2~ hour task vice 5-10 minutes.
The AdminCP part of XenForo phrase's system supports finding all phrases with a given set of content, and providing a "translate" screen to edit them all at once.

Alternatively, export the language as XML and manipulate that and then re-import over an existing language.
 
  • Like
Reactions: frm
Alternatively, export the language as XML and manipulate that and then import the language.
That probably would've been good to know.

But, since I was rebranding, I needed to find and replace usernames in quotes, etc. too. So, there really was no good way to achieve both phrasing and the rebrand without queries, unless I wanted to edit every single post, etc.

Nothing seems out of the ordinary after testing, except for the cached phrases that updated.

PS: Bought one of your add ons today. Somehow I missed something like that for XF2 (was only seeing XF1 versions).
 
But, since I was rebranding, I needed to find and replace usernames in quotes, etc. too. So, there really was no good way to achieve both phrasing and the rebrand without queries, unless I wanted to edit every single post, etc.
This add-on should help achieve that in a more robust manner: https://xenforo.com/community/resources/post-content-find-replace.5748/

Otherwise there will be data inconsistencies, like your search index still containing the old content for example. The inconsistencies can range from trivial to catastrophic depending on the nature of the queries. In this case it's likely not the end of the world, but just know that running direct queries is not supported in the event something does go wrong.
 
Back
Top Bottom