Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 83 replies, has 5 voices.

Last updated by George Botsev 2 years, 3 months ago.

Assigned support staff: Andrés.

Author Posts
August 29, 2018 at 6:15 am #2685033

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello!
We have a fix that our developers provided, so that you can test.
1. Update WPML Core to the latest 4.0.6
2. In the file wp-content/plugins/sitepress-multilingual-cms/classes/media/class-wpml-attachment-action.php replace the function delete_file_actions by the following code

 //check if the image is not duplicated to another post before deleting it physically
 public function delete_file_actions( $file ) {
 	static $saved_request = array();
 	if ( $file ) {
 		$file_name = $this->get_file_name_without_size_from_full_name( $file );
 		if ( array_key_exists( $file_name, $saved_request ) ) {
 			$attachment = $saved_request[ $file_name ];
 		} else {
 			$attachment_prepared = $this->wpdb->prepare( "SELECT pm.meta_id, pm.post_id FROM {$this->wpdb->postmeta} AS pm WHERE pm.meta_value LIKE %s", array( '%' . $file_name ) );
 			$attachment          = $this->wpdb->get_row( $attachment_prepared );
 			$saved_request [ $file_name ] = $attachment;
 		}
 		if ( ! empty( $attachment ) ) {
 			$file = null;
 		}
 	}
 	return $file;
 }
September 3, 2018 at 8:37 am #2698361

janeN-2

Hi,

I appear to be unable to read page 6, I can read pages 1-5 but everytime I visit page 6, I am redirected to page 1.
Last time this happened, posting an update like this allowed me to see the page!

Regards

September 3, 2018 at 8:39 am #2698364

janeN-2

Thats better!

So George, to confirm, do I need to update and then add this code or just update?
Assuming the code itself is the fix? Or did you simply want me to test the code on the latest version?

Kind Regards

September 3, 2018 at 8:50 am #2698375

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello
I am not sure if I follow you for the issue with page 6? Could you elaborate more please?

About the fix that I provided to you:
The code itself is the fix, however, you need first to update to WPML 4.0.6, as this fix will be released in next version of the WPML plugin.

September 3, 2018 at 9:16 am #2698446

janeN-2

Hi George,

The page 6 issue in detail here on the fourm:
I have logged on to wpml.org and come to the ticket, there are 6 pages here on the fourm, I navigate to page 6 and I am redirected to page 1... I can read the other 5 pages in the thread though... by posting, I am then able to see it! It's very strange but in the grand scheme of things, it's not something I'm too worried about.

As for the code, I'll try it now.

Kind Regards

September 3, 2018 at 9:24 am #2698491

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Ah, I understand.
That is nothing to worry about.
It is because of the private replies in the ticket and you might have visited the page without being logged in.
Clearing browser cache helps

September 17, 2018 at 11:55 am #2740763

janeN-2

Ok,
What you have asked us to try helped a little bit but didn't fix it.
We have now uninstalled WPML.

Thanks for your helps guys but on this ocasion we had to say goodbye,

September 17, 2018 at 1:42 pm #2741157

Andrés
Supporter

Languages: English (English ) Spanish (Español ) French (Français )

Timezone: Europe/Paris (GMT+01:00)

We are sorry to know that you have to say goodbye this time, Daniel.
Please, don't hesitate to contact us again if you need further help.
Best regards,
Andrés

October 17, 2018 at 12:55 pm #2824632

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

@janen-2 Our developers provided a patch that I just tested for this problem exactly.
I can see a very nice improvement in my local setup.

Please let me know if you wish to test it, and I can provide you with the changed files.