Hello @seccyeth,
Thank you for reaching us out!
We regret to inform you that we have not tested the Loops and Logic plugin with our LMS plugin and do not have experience in using such plugins. As a result, we are unable to offer any suggestions or details regarding the compatibility of the plugin.
Could you kindly provide a detailed demonstration of the specific code or script from our plugin that is causing the issue? I will then forward it to our development team for consideration.
Thank you in advance.
Best regards,
Hi Julia,
Although I understand you cannot test compatibility with every plugin, the issue is that it used to work, and Masterstudy is now plain preventing to use custom HTML. I’m not talking in Masterstudy’s course or anything, but in the plugin’s own interface, in the admin panel.
It used to work, and I tried to determine which update broke compatibility, but as 3.1 introduced the new course player along with a database update, going back and forth with Masterstudy created database issues, and I had to restore my DB with a backup. All I can now say for sure is that it was working 3.0.23, which is how far I could test before breaking my website. So, my first feeling was wrong, it was not 3.0.22 that broke compatibility, but probably 3.1.
I’m not asking you to fix this, although it would be great ofc, but as YOU made your plugin, I was hoping you could point me to where you implemented the changes in HTML filtering along with 3.1 update. This would allow me to debug and find a fix for this issue. Loops and Logic being paramount to my website, if rendered impossible to use, I’ll feel obligated to migrate toward LearnDash, which beneficit from deep integration.
HelloΒ @seccyeth,
Thank you for information.
We will be grateful if you can describe the issue in more detail and explain the steps of how you used Loops and Logic, for example, where did you add the code: to the course builder/course player, to the course or lesson page? And if possible, kindly send us a small code example. We will try to reproduce the issue. If the case is confirmed, we will forward the issue to our development team for consideration.
Best regards,
Hi Julia,
I can of course try to be more precise.
L&L (Loops and Logic) allow writing custom HTML as templates. This custom HTML is not written inside any content, it is written in a dedicated admin area. You can then include those templates on any page, and they’ll render what you coded (basically, it’s writing PHP with HTML syntax). You can check examples on their page, but here is one:
<ul>
<Loop type=post count=3 orderby=date order=desc>
<li>
<a href="{Field url}"><Field title /></a>
</li>
</Loop>
</ul>
Please note that the code is NOT written in any Masterstudy area. It is written in another admin area dedicated to this plugin.
The issue is not about this code not rendering. My templates are properly rendered. The issue is that Masterstudy PREVENTS me from writing and editing template in L&L admin area. You must have implemented something to filter custom HTML, but instead of applying this to Masterstudy only, it looks like it is affecting the whole website.
Therefore, if I try to create a new L&L template, or edit an existing one, then all the custom HTML gets erased upon updating or saving the template. This issue happens with only L&L’s and Masterstudy’s plugin activated. It doesn’t happen with only L&L. To reproduce the issue, it’s pretty simple.
- Install Masterstudy free plugin
- Install Loops and Logic
- Copy the template provided as an example in the dedicated template area
- Save your template
- You’ll notice that all custom HTML is now gone, and be left with
<ul>
<li>
<a href="{Field url}"></a>
</li>
</ul>
Hey there @seccyeth !
Thanks for the detailed explanation.
We were able to replicate the scenario. Before, there was sanitize in the code, which is why it was working.
I can guide you on where to check that function. It is located in _core/stm-lms-templates/questions/wrapper.php.
<?php echo esc_html( $question_explanation ); ?>
->
<?php echo $question_explanation; ?>
or
<?php echo sanitize_text_field( $question_explanation ); ?>
You can give it a try. Hope it helps!
Thanks!
Hi Joseph,
Thank you for acknowledging this issue. I have tried to apply the fix provided, but it did not solve the issue. Did you have any result with it? I’ve tried both options, and none worked for me.
Just to be sure, I’m not having any problem with putting HTML or custom html in Masterstudy’s questions. My issue is that Masterstudy prevents the input of custom HTML by Loops and Logic’s templates area. If I try to add custom HTML there, it still gets erased.
Hello Joseph,
Thank you for informing us.
We would greatly appreciate it if you could send us the entire code that you are attempting to apply via the Loops and Logic plugin. We will try to replicate the issue on our testing site and investigate it.
Best regards,
Hi Joseph and Julia,
Why are you stalling like this… π I’ve already sent you a piece of code in my previous message, any L&L code would replicate the issue. If you want, you can even put
<Loop></Loop>
And you’ll see it disappear.
Best regards,
Adrien
Hello Adrien (@seccyeth),
Our apologize, I have forwarded the case to our dev team. We will inform you if there are any updates.
Best regards,
Dear Adrien (@seccyeth),
We have identified the issue and our development team will fix it and include it in the new version of the LMS plugin in one update if there are no critical issues.
In the meantime, we can offer you a temporary solution. To apply the fix, we recommend commenting out the code from line 80:
add_filter( 'content_save_pre', 'masterstudy_lms_allow_iframe_in_content' );
in the file by the path plugins/masterstudy-lms-learning-management-system/includes/filters.php .
Best regards,
Hi Julia,
Sorry for the late answer. I’m glad you were able to find the culprit. I’ve applied your temporary fix, and it did solve my problem. I’ll be waiting for an update for a permanent fix.
Thank you for your work, I’m glad we were able to find a solution.
Best regards,
Hello @seccyeth,
I’m glad to know that the issue is solved. We will release an update with the fix once it’s ready and inform you in the changelog here: https://docs.stylemixthemes.com/masterstudy-lms/changelog-free-version
Best regards,