Closed Xon closed 8 years ago
Ok, thanks
I've implemented this; https://github.com/xon/xen_BBM_v2/tree/detectPhrases but I need to finish testing.
It doesn't come up normally due to the use of 'global' phrases. This change would allow those phrases to be removed from the global pool.
Hello, I can't find back what I've just written in your commit. What I wrote didn't make sense, did you try to check what you coded was working ?
I tested with single phrase per item, but not when there are two phrases in the same bit of text.
Ok thanks, I didn't know the magic function string was deferring its elements even when it was not in the view.
I've just tried... and it works great. Thanks again for the code and the information :)
Everything has been updated :) :+1:
When auditing on how to reduce some extra database queries, I noticed this _detectPhrases() could be improved.
It spins in a loop collecting XenForo_Phrase objects for each button, and immediately casting to a string. This causes a database query straight away.
A simple object wrapper with a _toString() method could defer this until all the phrases are resolved at once when the output from bakeQuattroParams/bakeRedactorParams is serialized into a string.
I'll submit a pull-request for this in a few days.