Profile text description does not save paragraph for rich text

Hello,

I am using the "enable rich text (html) snippet for profile info text.

add_filter(
	'hivepress/v1/models/user',
	function( $model ) {
		$model['fields']['description']['editor'] = true;

		return $model;
	},
	1000
);

What I am experiecing is that the paragraphs that were added are lost. For example, when a user adds a link to a youtube video in a new paragraph and saves, the link will show as a video.

But on the next time the user or vendor opens the edit profile page, the paragraphs for the profile info are lost. So when user or vendor hit save, the links are all on the same line as text, and for example videos are not visible anymore.

First image, when saving for the fist time:

Second image, when reopen the edit profile page the text becomes like this:

Is there a way to make sure the text and styles are saved in the way the user created it? My vendors sometimes write a long “Biography” and add link to videos. Each time they click edit profile, all gets wrong and must redo the styles to correct it.

Thanks

Thanks for reporting this, I added this issue to the bug tracker and will check it before releasing the next update. This may be related to the editor not refreshing issue reported in another topic.

Hello @ihor

is there a code snippet I could use to solve this issue for now? My goal is that the information added using rich text stay saved.
Right now each time the vendor clicks to edit his profile, and opens the edit profile page, all the rich text is lost and profile description gets wrong, including bold text, spaces, paragraphs.

I migrated completely to hivepress and there are 1.800 experts in my website, this week they started editing their profile info and I am having some trouble with support, so if there is any solution temporary please let me know.

Thank you

Sorry for the delay. A temporary solution will be provided in the coming days

1 Like

Thank you very much @yevhen this will help a lot.

Thank you for waiting. The bug is fixed, and it will be released in future updates. Please try this PHP snippet as a temporary fix

add_filter(
	'hivepress/v1/models/user',
	function( $model ) {
		$model['fields']['description']['editor'] = [
					'toolbar1'    => implode(
						',',
						[
							'bold',
							'italic',
							'underline',
							'strikethrough',
							'bullist',
							'numlist',
						]
					),
					'toolbar2'    => '',
					'toolbar3'    => '',
					'toolbar4'    => '',
					'elementpath' => false,
					'wpautop'     => true,
				];

		return $model;
	},
	1000
);
1 Like

Thank you very much @yevhen , this will help a lot!

Thank you, it worked!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.