michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
30 stars 42 forks source link

Bug: First video on page is gone after "FilterCodes" in ON globally #283

Closed caiadogithub closed 7 months ago

caiadogithub commented 7 months ago

Prerequisites

What happened?

When "FilterCodes" is ON globally, first video is not visible

ON

What do you think should have happened?

I expected all videos on page to be visible when "FilterCodes" is ON globally

OFF

Steps to reproduce

  1. Login as 'admin'
  2. Go to '/admin/filters.php'
  3. Click on 'Filter Codes' and enable it.
  4. Access any page with more than one YouTube URL
  5. See error or issue.

ON

Screenshots

No response

Moodle version

Moodle 3.11.16+

Installed Moodle UI Language packs.

If other language(s), please specify

EN, PT-BR

Workaround

No.

Additional information

No response

System information

Client Device type: Desktop Client Operating System: Ubuntu, Windows Client Web Browser: Chrome, Edge, Firefox Server Operating System: Ubuntu Server Webserver: Apache2 Server PHP: 7.4

Code of Conduct

michael-milette commented 7 months ago

Hi @caiadogithub ,

I tested on both Moodle 3.11 and 4.0.3 but I could not reproduce the issue you described.

image

Could you share the HTML that you are using?

Best regards,

Michael

caiadogithub commented 7 months ago

Hi, @michael-milette

Here are the HTML codes from the pages where the first video is gone:

(1) Firefox_Screenshot_2023-12-12T13-19-45 929Z

(2) Firefox_Screenshot_2023-12-12T13-20-01 592Z

Ricardo ``

michael-milette commented 7 months ago

Hi @caiadogithub ,

I typed in your exact HTML code into Moodle 3.11 course Labels.

image

Works fine for me, with FilterCodes enabled and disabled.

The only thing I can suggest is that you go to Site Administrator > Plugins > Manage Filters and make sure that FilterCodes is at the top of the list of filters.

There is nothing in the HTML that you provided that would cause FilterCodes to have any effect on it. FilterCodes checks the content of the field for the occurence of a "{" character. If it doesn't find one, it does not process anything in the field. That said, if you are using FilterCodes elsewhere in the page, it could potentially affect it.

You could also try set debugging to DEVELOPER mode and check the box to show errors. This might reveal if there is a coding issue.

Unfortunately, based on the limited information that you have shared, I am not seeing the issue. Although the issue only appears when you enable FilterCodes, it could be a conflict with another plugin you have installed. The problem is, if I cannot reproduce the issue, I cannot fix it for you.

If you would like to consider premium support, I would be happy to troubleshoot your issue further by connecting to your website to determine what is going on. Just contact me through my website at https://www.tngconsulting.ca/contact.

Best regards,

Michael

caiadogithub commented 7 months ago

@michael-milette

"The only thing I can suggest is that you go to Site Administrator > Plugins > Manage Filters and make sure that FilterCodes is at the top of the list of filters."

It works now!!

Thanks!

Ricardo

michael-milette commented 7 months ago

HI @caiadogithub ,

Glad you got it working. Thanks for sharing the solution.

Best regards,

Michael Milette