Jump to content

[SOLVED] Not all language tabs for the multilingual field have been saved


Matzn
 Share

Recommended Posts

I want to save HTML Code in multilanguage field (productDescription -> texarea, unknow text) from module. But for the last language is nothing written in this field. It only works when I sanitized the string.

 

       

        foreach ($this->languages as $language) {

            $this->user->language = $language;

            //get spreadshit product data
            $this->productTypeData = $this->getProduct($language);
           

 			$this->page->of(false);
            //fields by language
            $this->page->title = $this->productTypeData->name;
            $this->page->fit = $this->productTypeData->sizeFitHint;
            $this->page->shortDescription = $this->productTypeData->shortDescription;
            $this->page->productDescription = $this->productTypeData->description; //include html tags

            $this->page->save();

        }

		

 

Link to comment
Share on other sites

  • Matzn changed the title to Save to multilanguage field

I've tested alternate syntax with "setLanguageValue" . Get the same result. But to sanitized the input from field "productDescription" works:

$this->page->productDescription = $this->sanitizer->textarea($this->productTypeData->description);

Are there bad signs that cause this to skip? As I said, only at the last language (danish). If i change the language order, it's always the last language.

Unbenannt.PNG

Link to comment
Share on other sites

Hi @bernhard. I've tested all field settings, but nothing works. I want html to save, because i think i can. ?

Edit:
But now i found something by save directly this field (i am surprised why get this exception not by saving the page - maybe it´s different by saving from template or module):

$this->page->save("productDescription");

I get a SQL error by can't save this table: it was too big or similar message (can't remember on the exact message). This means, the data to save is too big for this table ( field_productDescription). So i've set the table to ROW_FORMAT=DYNAMIC. This is a general problem and know it from other multilanguage sites - but forget. ?

Link to comment
Share on other sites

  • Matzn changed the title to [SOLVED] Not all language tabs for the multilingual field have been saved

The error message as mentioned above:

Quote

Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. (in wire/core/Fieldtype.php line 1333)

Now change the affected field to ROW_FORMAT=DYNAMIC like:

ALTER TABLE `mytable`  ROW_FORMAT=DYNAMIC;

In my case for field productDescription:

ALTER TABLE `field_productDescription`  ROW_FORMAT=DYNAMIC;

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...