DeuxHuitHuit / multilingual_field

Multilingual Textbox field for Symphony CMS
http://symphonyextensions.com/extensions/multilingual_field/
Other
12 stars 13 forks source link

Wrong string count when HTTP request encoding is different from default server encoding #18

Closed nitriques closed 10 years ago

nitriques commented 13 years ago

I have a client that reported she typed in only 60 characters when the limit is set to 70 and she had an error reporting that there was too many chars.

I looked deeper and found out that I needed to use mb_strlen(trim($value), 'utf-8') instead of strlen($value) in order to make it work.

This is a temporary fix and I want to check with you how can we make a change in the extension while preseving which encoding the programmers use and returning the right count.

This is not an heavy or often repeated method we are dealing with so there is not fear so calling mb_strlen.

nitriques commented 12 years ago

@6ui11em This issue has been bugging me since a long time now... And I did not came across anything better than the suggested fix above. Would you consider integrating it ?? Thanks.

6ui11em commented 12 years ago

With the next update we will extend the Texbox Field extension and we will use all his original methods, then could be a good moment to check this.

nitriques commented 12 years ago

Nice. But the textfield has the same problem with different counts with differents text enconding. See my other comment on extending the textfield...

6ui11em commented 12 years ago

then if this is a problem is present in the Textbox Field extension the issue may be fixed there, the idea of the next release of multilingual text field is to extends the parent extension and use his methods. Textbox Field extension will be required to use multilingual textfield.

nitriques commented 12 years ago

Are you talking about Symphony core fields ??? Or the other extension ?

6ui11em commented 12 years ago

Multilingual Text field es based on Texbox Field from Rowan Lewis:

https://github.com/rowan-lewis/textboxfield/

nitriques commented 12 years ago

AAAAA I got confuse again !!!

vlad-ghita commented 12 years ago

Just like Multilingual Entry URL Field extends Entery URL Field so it can take advantage of it's functions and not re-invent the wheel, so will Multilingual Field extend the Text Box Field.

Btw, @6ui11em , shouldn't this be renamed to Multilingual Text Box Field?

6ui11em commented 12 years ago

Good point, I will considere it when re-write the extension,

nitriques commented 12 years ago

I would agree on that rename.... And I would consider coding a 'facade' extenstion (just like nil's stage librairy) for multilingual extensions. We code now build multilingual extension really simply !

vlad-ghita commented 12 years ago

@6ui11em

Frontend Localisation 1.4 is out. It now encloses Frontend Language management => no more language redirect dependency.

It supplies FLang information and some assets for multilingual components (eg: the UI multilingual tabs).

Here's an example implementation from multilingual_imageupload (and other places where I'm using the tabs, eg: Page LHandles, multilingual*, Frontend Localisation, a future Section LHandles ;) ):

  1. Load Frontend Localisation assets. Recommended from your driver.
  2. The wrapper must have a class .field-multilingual.
  3. Build the tabs as usual.

Frontend Localisation initializes the language tabs wherever it finds a .field-multilingual class.

Can you please give an ETA for when multilingual text will be updated?

Thank you.

6ui11em commented 12 years ago

@vlad-ghita

Great!

I'm in the middle of a project and I'm so busy but I will try to find some time to update the extension. Maybe next week I could do something.

@vlad-ghita, @nitriques

I pushed the Multilingual Tag Field:

https://github.com/6ui11em/multilingual_tag_field

I used it in small project, I would like to do more tests before release it to the community but now I don't have this time. Maybe you could test the extension and give me some feedback and I will try to publish it next week with the multilingual text field update. This extension was based on your upload fiels so I think is adapted to the new multilingual fields dependecies.

All your comments are welcome.

vlad-ghita commented 12 years ago

I pushed the Multilingual Tag Field

Cool stuff !

I'll have a look.