Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Ramiro

Incompatibility with WPML in Trash

Hello.

WordPress: 4.4.2 (multisite install)
Admin Columns Pro: 3.7.4
Admin Columns – Advanced Custom Fields add-on: 1.3.3
Advanced Custom Fields Pro: 5.3.4
WPML: 3.3.6
Custom Post Type UI: 1.2.4
Other plugins: Disabled

After deleting a CPT post, when loading the Trash list page (edit.php?post_status=trash), this error appears at “icl_translations” column, when trying to load the column value:

Fatal error: Call to a member function get_status_html() on a non-object in <hiding_my_path>\wp-content\plugins\sitepress-multilingual-cms\sitepress.class.php on line 4083

Going to “sitepress.class.php”, I’ve noticed that this error happens in “add_content_for_posts_management_column” function, because “$this->post_status_display” is not an object, and so it can not call to its supposed “get_status_html” function.

“$this->post_status_display” object should have been instantiated in “add_posts_management_column” function (at same file) but never gets to the instantiate object line because it enters into this “elseif”:


} elseif ( empty( $posts ) ) {
return $columns;
}

The fact is that when Admin Columns Pro plugin is disabled, the Trash list is working, and WPML doesn’t show the language column (“icl_translations” column).

I haven’t been able to guess why is this happening, from an Admin Column Pro (=ACP) point of view. It seems that ACP is, in some way, forcing to WPML to run the “add_posts_management_column / add_content_for_posts_management_column” functions in some early WordPress execution, when neither “$posts” nor “get_query_var( ‘post_status’ )” contains any value (in which case the error wouldn’t arises).

My solution it’s been modifiying the file: wp-content\plugins\admin-columns-pro\codepress-admin-columns\classes\storage_model.php

I’ve added this code to the function “add_headings”, after the “foreach”. Like this:


foreach ( $stored_columns as $column_name => $options ) {
if( $_GET['post_status'] == 'trash' && $column_name == 'icl_translations')
continue;

This has the effect of not trying to render the WPML column when we are in Trash. I think it would be much more appropiate, something like this:


foreach ( $stored_columns as $column_name => $options ) {
if( get_query_var( 'post_status' ) == 'trash' && $column_name == 'icl_translations')
continue;

But this function seems to run in an early WordPress status, and this is not possible.

Could you shed some light into this issue?

Thanks.

5 years, 6 months ago
Stefan
Developer

Hi Ramiro,

Thank you for your feedback.
I like to discuss this with the team and try to find a proper solution for this in our plugin.

5 years, 6 months ago
Tobias
Developer

This issue has been resolved in the latest 3.8.x release.

5 years, 5 months ago
Ramiro

Tested and working. Thanks.

5 years, 5 months ago
Stefan
Developer

You’re welcome. I will close this ticket

5 years, 5 months ago
Saulo

Hi!

I have the same problem in trash and it didn’t fix after update all plugins

Fatal error: Call to a member function get_status_html() on null in /Volumes/Arquivos/Sitez/_FOUROFUS/FBDH/fbdh_wp/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4046

I’m using:

WordPress: 4.5.3
Admin Columns Pro: 3.8.6.1
Admin Columns – Advanced Custom Fields add-on: 1.3.4
Advanced Custom Fields Pro: 5.3.9.1
WPML: 3.4.1
Custom Post Type UI: 1.3.5

5 years, 2 months ago

You must be logged in to reply to this topic.