Vanilla built-in filters not working
After having activated this plugin (which is very cool and handy by the way), I noticed the build in filters for replacing Youtube links with embedded videos and marking @-mentions stop working (no error msg, just as if they do not exist). As this leads to a loss of important functionality I have to deactivate your plugin until someone comes up with a solution.
I use Vanilla 2.0.18.1 and Vanilla Twitter Embed 0.2.
I have only enabled some of the default plugins: Emotify, WYSIWYG (CLEditor) and the sign-in plugins.
Best Answer
-
UnderDog MVP
Kiwii said:
I would look into this myself, but I am painfully unfamiliar with Vanilla's source and api.You don't have to be familiar with the source code and api to look into the problem.
What you have to find, using a text editor that can search into files is at which moment the @-mentions are executed. It's an event that is executed.
I think that event conflicts with the event from the twitter plugin.good luck
There was an error rendering this rich post.
0
Answers
Could be one of the sign in plugins, have you disabled in different sequences to isolate the issue, sometimes js calls in wrong load order can affect functionality.
There was an error rendering this rich post.
Having disabled all plugins but 'Twitter Embed' I am now certain that the problem relies in this plugin. To clarify my problems: Having enabled 'Twitter Embed', links to Youtube videos are no longer replaced by embedded videos. And mentions (like @Kiwii) are no longer replaced by links to the profiles. Those two filters are build into Vanilla and should not be dependent on other plugins.
However 'Twitter Embed' itself functions exactly like it is supposed.
I noticed this plugin being published for Vanilla 2.0.18 and I use Vanilla 2.0.18.1. Could it be possible that the plugin needs to be updated? I have not yet looked at the code myselv, but I think it is possibly a return code or similar that is interpreted by Vanilla in the way that default text replacements are not to be executed (Vanilla may think the plugin completely displaces them).
Thank you for caring
Have you opened firebug and looked at Dom Events ?
There was an error rendering this rich post.
@422 not yet as I am not on my production pc; but I do not think that it is a client side problem, as the replacement of username mentions with links to the user's profile is not dependent on javascript (works with js disabled). I think the problem relies at the server's side in the php code.
If you are referring to twitter embed its fair to assume it could simply be an id collision
There was an error rendering this rich post.
No Vanilla plugins & Javascript disabled -> Mentions & Youtube videos working.
Only 'Twitter Embed' in Vanilla & Javascript disabled -> Mentions & Youtube videos not working.
My problem has nothing to do with javascript or anything client-side. The server-side php code that should replace @nickname mentions and youtube links (and which is part of Vanilla) is just not executed if the plugin 'Twitter Embed' is enabled. Because this plugin hooks into the server-sided post parsing I believe it somehow makes Vanilla not execute it's own parsing methods. As this problems would have been noticed on the first release of this plugin, I assume the problem is caused by the Vanilla update '2.0.18->2.0.18.1'. It's either a change in the api or simply a bug.
I would look into this myself, but I am painfully unfamiliar with Vanilla's source and api.
You don't have to be familiar with the source code and api to look into the problem.
What you have to find, using a text editor that can search into files is at which moment the @-mentions are executed. It's an event that is executed.
I think that event conflicts with the event from the twitter plugin.
good luck
There was an error rendering this rich post.
Okay, I think I begin to understand the problem:
The 'Twitter Embed' plugin gets the unformatted post content
$Object->Body
, does it's own filteringTwitterEmbed(..);
and overwrites the already formatted (by the core) content with it's formatted version.$Object->FormatBody = $this->...
Because the replacement of @-Mentions and Youtube links is done before this, there is already formatted content in the
$Object->FormatBody
variable.However changing the line to
fixes the problem but creates a new one, too: The @username mentions and youtube links are working fine now and twitter links are replaced by embedded tweets, but above each Tweet, the content of the Tweet is replicated. This happens because the regex has to be rewritten to understand the formatted links instead of unformatted links. Well, I try to look into this, but I am not very used to regexes.
Yeah, my new Regex looks like that:
And now, the plugin works like I expected it to without interfering with Vanilla's core features.
If anyone is interested in this, I uploaded the modified version of VanillaTwitterEmbed/class.vanillatwitterembed.plugin.php to Pastebin but I do not know if this works with every Vanilla installation and I do not give any guaranty.
If I could give out developer badges, I would give one to you right now. Excellent work!
Maybe a new version of the plugin could be uploaded. I'll alert @JamieChung if he wants to do it.
There was an error rendering this rich post.
Thanks everyone for looking at this. @Kiwii @UnderDog @422
I'm reviewing everything now and publishing an updated version. Good catch especially @Kiwii!
The plugin has been updated to 0.3
Official changes made on Github: https://github.com/JamieChung/VanillaTwitterEmbed/commit/a9e345c82420458b7156979534bde4bec30b982c
Thanks again guys, I am glad people are finding use of the addon I made.