Skip Navigation

[Resolved] I can not edit custom post type posts belonging in specific categories.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 14 replies, has 2 voices.

Last updated by Nigel 1 year, 10 months ago.

Assisted by: Nigel.

Author
Posts
#2539519

I am trying to:
Posts belonging to specific category displays a white screen when I try to edit them. This happened after activating WPML.
It is related to the following support ticket with the cleanup robot closed before a solution (and not a workaround) is found.
https://wpml.org/forums/topic/some-custom-taxonomies-are-missing-and-edit-custom-post-types-problem/

I can't edit scientific products belonging to some categories. For example, products in the following category
hidden link

For example, the following product
hidden link

WPML support told me that there is a fatal error on your site while editing the custom CPT from Toolset Blocks.


[22-Jan-2023 14:53:11 UTC] PHP Fatal error: Uncaught InvalidArgumentException: Wrong value provided for the translation language. in /var/www/vhosts/targetanalysis.gr/staging1.targetanalysis.gr/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/Version2/AssociationQuery/ElementSelector/AllLanguagesSelector.php:70
Stack trace:
#0 /var/www/vhosts/targetanalysis.gr/staging1.targetanalysis.gr/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/Version2/AssociationQuery/ElementSelector/ElementSelectorProvider.php(193): OTGS\Toolset\Common\Relationships\DatabaseLayer\Version2\AssociationQuery\ElementSelector\AllLanguagesSelector->__construct(Object(OTGS\Toolset\Common\Relationships\DatabaseLayer\UniqueTableAlias), Object(OTGS\Toolset\Common\Relationships\DatabaseLayer\Version2\AssociationQuery\TableJoinManager), Object(wpdb), Object(OTGS\Toolset\Common\WPML\WpmlService), Object(OTGS\Toolset\Common\Relationships\DatabaseLayer\Version2\TableNames), Array, false, NULL, false, Array, Array)
#1 in /var/www/vhosts/targetanalysis.gr/staging1.targetanalysis.gr/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/inc/m2m/DatabaseLayer/Version2/AssociationQuery/ElementSelector/AllLanguagesSelector.php on line 70

WPML support told me that the editing screen works correctly when deactivating Toolset Blocks and suggest to open a ticket for Toolset support to check it?

You can see the WPML support here:
https://wpml.org/forums/topic/i-can-not-edit-custom-post-type-post-belonging-in-specific-categories/

#2539789

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

As the issue involves provoking fatal errors I took a copy of your site to work on locally where I can debug such errors more easily.

My local copy is a minimal install, meaning I only have the key plugins installed (Toolset and WPML), but in that case there are no errors, the edit screen loads normally.

So it looks like this may need some 3rd party code to reproduce the error.

Is it okay to work on the staging site, deactivating plugins and reactivating as required to try and narrow down what else is required? (It would be easier to keep track of that if I was able to delete the inactive plugins left over on your site.)

#2540043
edit-post-2023-01-23.png

Hi,

As you can see from the screenshot, the problem doesn't exist on the website hidden link. On this website, the WPML plugin isn't activated. Moreover, WPML support deactivated the Toolset and the problem was solved. So without WPML works and without Toolset works. However, you can do whatever you want on the staging1 website. I don't know if you could align with the WPML support as they have also access to it for some other problems.

#2540421

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I've identified the problem, it occurs with Toolset Blocks and WPML when the plugin Download Monitor is also active. Disable that plugin and the error doesn't occur, even when both Blocks and WPML are active.

I've confirmed the same happens on my local copy of your site, where I can look into this further to try and identify why.

Before I do that, though, can you just confirm that you do actually need all 3 plugins active on your site, and that the downloads plugin isn't just a relic of trying something out which you no longer need?

#2540457

Hi,

We need the Download Monitor plugin. Why this happens in the posts of some specific categories and not in all of them?

#2540465

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I don't know, that's what I need to uncover by debugging the code execution on such pages.

I'll go ahead with that and get back to you.

#2541371

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, I spent a good few hours on this, and have now had to pass it to the developers for them to investigate further.

I did identify what specifically triggers the issue. In case it is anything you can do something about, I don't think it relates to the category of Science Product posts that is the trigger for the problem, rather it is posts (such as amaZon speed) that include the download shortcode in the "Downloads" WYSIWYG custom field value.

That download shortcode gets parsed when the value of the WYSIWYG field is prepared, and—this is as far as I got—that somehow messes with the language setting for the page and ultimately triggers the error.

I'll let you know when I get some feedback from the developers.

#2541733

OK, understand, thank you for the explanation. Did you manage to understand why only some posts have this problem?

#2541753

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I don't know exactly which posts have the problem and which not, but a key element is including the download shortcode in the Types wysiwyg field. If there is something else at play, too, that should be uncovered when the developer completes the debug work.

#2542763

OK, thank you. Let's wait for the developer.

#2544809

Hi,

Is there any progress?

#2545405

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, nothing to report yet.

It's with the developers and they have a queue of issues to work through.

I'll get notified of any updates from them and I'll share them with you.

#2558661

Hi,

Just checking to see if there is any news. It was more than a month ago when I reported the issue!

#2558685

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, I don't have anything for you yet, I know the developers are trying to finalize a series of updates for an upcoming set of plugin releases.

I have commented on the internal ticket for this issue asking for some feedback, and I'll share it when I have it.

#2560117

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kostas

I'm pleased to say our developer has identified the problem, which arises because the Downloads Monitor plugin uses the WPML API incorrectly, and the issue you see with Types is a side effect of that.

We have submitted suggested changes to the Downloads Monitor plugin authors that will fix the problem.

In the meantime you can get a patched file from here: hidden link

Unzip that file and replace the file of the same name at plugins/downloads-monitor/src/Download/WordPressDownloadRepository.php