Notifications
Clear all

"wpDiscuz - Media Uploader" extension breaks ElasticPress

6 Posts
3 Users
1 Reactions
1,469 Views
Posts: 6
Customer
Topic starter
(@alexander-schneider)
Member
Joined: 5 years ago

In the case the wpDiscuz extension Media Uploader is active the settings page of the Plugin ElasticPress is broken.

Steps to reproduce:

  1. fresh installation of WordPress
  2. fresh installation wpDiscuz Plugin
  3. fresh installation of ElasticPress Plugin
  4. go to https://wordpress-site.com/wp-admin/admin.php?page=elasticpress and open some settings (for example "Autosuggest") -> settings are available
  5. fresh installation of the extension "wpDiscuz - Media Uploader"
  6. go to https://wordpress-site.com/wp-admin/admin.php?page=elasticpress and open some settings (for example "Autosuggest") -> settings are not available and broken

You don't have to support ElasticPress of course, but please take care on this bug report because if one plugin breaks another one this definitly should not be happen.

5 Replies
Astghik
Posts: 6193
Admin
(@astgh)
Illustrious Member
Joined: 7 years ago

Hi @alexander-schneider,

We're going to check the issue. I'll update the topic asap. 

Reply
Posts: 6
Customer
Topic starter
(@alexander-schneider)
Member
Joined: 5 years ago

ElasticPress has some wp-cli commands, for example for indexing posts.

In case of wpDiscuz extension Media Uploader is active, following error-stack occurs on "wp elasticpress index --setup":

PHP Fatal error: Uncaught Error: Call to a member function isLoadWpdiscuz() on null in /my-path/wp-content/plugins/wpdiscuz-media-uploader/class.WpdiscuzMediaUploader.php:273
Stack trace:
#0 /my-path/wp-includes/class-wp-hook.php(288): WpdiscuzMediaUploader->oembedTtl(86400, 'https://twitter...', Array, NULL)
#1 /my-path/wp-includes/plugin.php(206): WP_Hook->apply_filters(86400, Array)
#2 /my-path/wp-includes/class-wp-embed.php(214): apply_filters('oembed_ttl', 86400, 'https://twitter...', Array, NULL)
#3 /my-path/wp-includes/class-wp-embed.php(428): WP_Embed->shortcode(Array, 'https://twitter...')
#4 [internal function]: WP_Embed->autoembed_callback(Array)
#5 /my-path/wp-includes/class-wp-embed.php(410): preg_replace_callback('|^(\\s*)(https?:...', Array, '<!-- wp:paragra...')
#6 /my-path/wp-includes/class-wp-hook.php(288): WP_Embed->autoembed('<!-- wp:paragra...')
#7 /my-path/wp-inc in /my-path/wp-content/plugins/wpdiscuz-media-uploader/class.WpdiscuzMediaUploader.php on line 273

Hopefully this helps you to find the problem.

Best regards

Reply
1 Reply
Astghik
Admin
(@astgh)
Joined: 7 years ago

Illustrious Member
Posts: 6193

@alexander-schneider,

Could you please send the admin login details to info[at]gvectors.com email address. There is no such issue on our test websites. 

 

Reply
Posts: 6
Customer
Topic starter
(@alexander-schneider)
Member
Joined: 5 years ago

There is no such issue on our test websites.

Sorry, but your developers didn't a good job, because I have gave the issue and the steps to reproduce to another developer and he can reproduce this issue.

But ok... here is the detailed error (code/line) and the solution to fix this error...

In wp-content/plugins/wpdiscuz-media-uploader/class.WpdiscuzMediaUploader.php, line 69 replace:

add_filter('wp_kses_allowed_html', array(&$this, 'filterKses'));

...with:

add_filter('wp_kses_allowed_html', array(&$this, 'filterKses'), 10, 2);

In wp-content/plugins/wpdiscuz-media-uploader/class.WpdiscuzMediaUploader.php, line 155 replace:

public function filterKses($context) {
global $allowedtags;

...with:

public function filterKses($allowedtags, $context) {

The problem was, the first argument is an array with the allowed tags and not the context.

With these changings everything works fine and wpDiscuz doesn't break ElasticPress which uses the filter wp_kses_allowed_html in the correct way.

Reply
1 Reply
Elvina
(@elvina)
Joined: 5 years ago

Support
Posts: 1403

@alexander-schneider,

This will be fixed in the next version update.

 

Reply
Share:
Scroll to top