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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

This topic contains 13 replies, has 2 voices.

Last updated by Kor 2 months, 3 weeks ago.

Assisted by: Kor.

Author Posts
August 20, 2023 at 6:00 am #14257657

robinB-8

I am trying to: insert svg in footer widget

Link to a page where the issue can be seen: hidden link

I expected to see: SVG show in my footer widget in frontend

Instead, I got: SVG don't show in my footer widget in frontend

111.png
August 21, 2023 at 8:38 am #14261087

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi there,

Thanks for contacting WPML support.

Sorry, your Website no longer works. hidden link .

I'm getting the error shown in the attached screenshot.

Screenshot 2023-08-21 at 4.37.06 PM.jpg
August 21, 2023 at 9:15 am #14261577

robinB-8

Please check this address: hidden link

August 21, 2023 at 2:28 pm #14264999

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

August 22, 2023 at 8:21 am #14268795

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I've checked and I can see the issue you had there. Looks like the media translation plugin is causing issues with the SVG file as it seemed to work when I deactivated it.

I will forward this to a 2nd Tier Support for further assistance.

August 28, 2023 at 8:19 am #14298097

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I have feedback from our 2nd Tier Support.

Please check out this errata https://wpml.org/errata/svg-support-activating-wpml-media-strips-uploads-folders-from-svg-image-url/ and follow the workaround provided.

Then, reupload the SVG file and it should work. Could you backup and give this a try and let me know how it goes?

August 28, 2023 at 10:19 am #14299453

robinB-8

If I follow Workaround, I will have to do again when SVG Support plugin update.

And I see "Resolved in: 4.5.9" meaning I don't need follow Workaround?

August 28, 2023 at 10:21 am #14299455

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Yes, that is correct. You need to modify the SVG Support plugin file every time it updates. We've contacted the plugin author and we will follow up. Hopefully, we can have this changes permanently applied to that plugin.

August 28, 2023 at 10:22 am #14299457

robinB-8

thanks, when WPML have this changes permanently applied to that plugin, can you reply me via here?

August 28, 2023 at 10:24 am #14299463

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for getting back to us.

Absolutely, we're on it. If the ticket happens to be closed in the meantime, no need to be concerned. We'll ensure to keep you posted once we have any feedback to share.

August 28, 2023 at 10:28 am #14299479

robinB-8

thanks

August 30, 2023 at 5:09 pm #14315393

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

I appreciate your patience.

The matter you're encountering is a recognized issue linked to the SVG support plugin. Our 2nd Tier Support has already contacted the author of the plugin to address this concern.

For the time being, I suggest implementing the following PHP code into your theme's functions.php file. You can place it at the end of the code. If you're uncertain about this process, please inform me, and I'll be glad to apply the workaround on your behalf.

// WPML Workaround for compsupp-6933
add_filter('wp_get_attachment_metadata', 'wpml_compsupp6933_fix_attachment_metadata_file_path', 10, 2);

function wpml_compsupp6933_fix_attachment_metadata_file_path($data, $attachment_id) {

	// Only apply the workaround if WPML Media and SVG Support plugins are active
	if( class_exists('WPML_Media') && function_exists('bodhi_svgs_generate_svg_attachment_metadata') ) {
		
		if (isset($data['file']) && !preg_match('/\d{4}\/\d{2}\//', $data['file'])) {
			// Get the upload directory info
			$upload_dir_info = wp_upload_dir();
	
			// Extract the year and month from the basedir
			$year_month = date('Y/m', strtotime(get_post_field('post_date', $attachment_id)));
	
			// Prepend the year and month to the file
			$data['file'] = $year_month . '/' . $data['file'];
			
		}
	}    

    return $data;
}
August 31, 2023 at 11:11 am #14319821

robinB-8

thanks, please notify me when your core plugin update, and I will remove this code

August 31, 2023 at 3:24 pm #14322219

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

The changes have to be done on the SVG Support plugin side. But anyway, we have already notified the plugin author here https://wordpress.org/support/topic/issue-with-wpml-media-translator/ and hopefully they will respond to us.

February 26, 2025 at 2:37 am #16748696

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I have an update from our second-tier support and they mentioned that the issue is fixed by the plugin author. Please update the SVG Support plugin to the latest version and retry.

The topic ‘[Closed] svg broken in widgets’ is closed to new replies.