Meta tags appears truncated

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/7/2012 10:57:40 PM
Gravatar
Total Posts 23

Meta tags appears truncated

Hi Joe,

There is a bug in the custom meta tags print for page.

I added some tags for facebook (open graph), but always the las tag is trunkated, I have to add a "trash" tag to keep the important tags well built

 

look image source code: http://i5.pixs.ru/storage/4/0/0/bugtaggif_4505653_4216400.gif

and there is my tag configuration: http://i5.pixs.ru/storage/4/0/6/tagsetgif_2154403_4216406.gif

I have it right now in my page 

3/8/2012 7:29:13 AM
Gravatar
Total Posts 18439

Re: Meta tags appears truncated

Hi Alexei,

I tried to re-create this problem on my local machine by copying your meta data into one of my pages but it works correctly here.

I would check to make sure you haven't got any new line characters or some strange not visible character in the one that is getting truncated.

Or you can try to reproduce the problem on our demo site then I can look in the database.

Just a side note your site is in Russian but you have English specified in the layout.master:

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">

probably should change that but I'm sure it is not a factor in this problem.

Best,

Joe

3/8/2012 8:55:55 AM
Gravatar
Total Posts 23

Re: Meta tags appears truncated

in fact, the problem is that is russian text in description, maybe the Encoding is wrong, and characters are trunkated by the operation. 

I just changed all the text of the meta tags to english, and the problem was fixed. But when it is russian - problem persists Frown even with the language set lite that: 

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="ru-RU" xml:lang="ru" xmlns:fb="https://www.facebook.com/2008/fbml">

3/8/2012 9:00:53 AM
Gravatar
Total Posts 23

Re: Meta tags appears truncated

I could not recreate the problem in demo site, may be the its also database, I'm using mySql, Let me see with the source code, I will tell you what is going on... Cool

3/8/2012 9:15:34 AM
Gravatar
Total Posts 18439

Re: Meta tags appears truncated

As long as your database tables and columns are utf8_general_ci and your connection string has Charset=utf8; it should not be a problem.

Hope that helps,

Joe

3/8/2012 11:57:50 AM
Gravatar
Total Posts 23

Re: Meta tags appears truncated

I already have Charset=utf8;

and in the DB I have the right encoding:

33 CompiledMeta text utf8_general_ci Yes NULL

and I found that the CompiledMeta is building well, and arParams have right data, but after saving:

int rowsAffected = MySqlHelper.ExecuteNonQuery(
GetWriteConnectionString(),
sqlCommand.ToString(),
arParams);

I also tryed to change the value directly in DB to set it to the right one, and I had no problem doing it directly in DB (with phpMyAdmin).

...Undecided

3/8/2012 11:58:37 AM
Gravatar
Total Posts 23

Re: Meta tags appears truncated

I mean the problem is comming when the value is saved, maybe SQL Connector is not working well... ?

3/8/2012 12:22:54 PM
Gravatar
Total Posts 18439

Re: Meta tags appears truncated

Hi Alexei,

Reviewing the source code in dbPageSettings.cs I see a probable cause.

The CompiledMeta param is declared as Blob instead of Text in the create and Update Method

I am changing it in  my copy from this:

arParams[29] = new MySqlParameter("?CompiledMeta", MySqlDbType.Blob);
arParams[29].Direction = ParameterDirection.Input;
arParams[29].Value = compiledMeta;

to this:

arParams[29] = new MySqlParameter("?CompiledMeta", MySqlDbType.Text);
arParams[29].Direction = ParameterDirection.Input;
arParams[29].Value = compiledMeta;

Can you try that solution?

Hope that helps,

Joe

3/8/2012 1:05:10 PM
Gravatar
Total Posts 23

Re: Meta tags appears truncated

Yes it worked

Fixed !


You must sign in to post in the forums. This thread is closed to new posts.