WPChill / download-monitor

A WordPress plugin which provides an intuitive UI for uploading and managing downloadable files (including support for multiple versions), inserting download links into posts & logging downloads.
http://wordpress.org/extend/plugins/download-monitor/
262 stars 117 forks source link

PHP fatal errorr when using together with WPML and Toolset Types #1225

Closed decodekult closed 1 year ago

decodekult commented 1 year ago

Describe the bug When using combined with WPML and Toolset Types, the plugin can fire a PHP fatal error as the current WPML language might be switched to all before firing a query, but not restored afterward.

To Reproduce Steps to reproduce the behavior:

  1. Using Toolset Types, generate at least two post types A and B, and define a relationship between A and B, be it one-to-one, one-to-many or many-to-many, as described in this documentation. Also, generate a field group for the A post type, and include a WYSIWYG field on it, as described in this documentation.
  2. Create at least one post of type A, Apost, and one post of type B, Bpost, and connect them over the relationship created earlier.
  3. Create a download using the Download Monitor plugin.
  4. Include the [download...] shortcode for that download in the WYSIWYG field content for the Apost post, and save the post in the editor.
  5. Reload the post editor page and see that it fires a PHP fatal error and the page goes blank.

Expected behavior The post edit page should load properly.

Screenshots If applicable, add screenshots to help explain your problem.

Extensions installed and activated:

Additional context I am the main developer of the Toolset set of plugins, as well as part of the WPML Compatibility team. I have debugged the issue and found the root cause for it, so a Pull request addressing the problem is going to be ready and open in the next minutes and linked here. In it, I will basically:

decodekult commented 1 year ago

THis is the related PR: https://github.com/WPChill/download-monitor/pull/1226

razvanaldea89 commented 1 year ago

Thank you for the PR @decodekult, we'll include it in the 4.7.77 version. Most probably will be launched in 2 weeks, on 6th of March.

Wamly, Razvan