Page 1 of 1

[SOLVED] AdvancedContent fields content get deleted when editing page

Posted: Wed Sep 22, 2010 11:31 am
by Milhaus
When i try to use AdvancedContent created blocks in templates, created in MLE, content was saved in them, but it got deleted, when I edited the page again.

Is there some possibility to fix this?

Re: AdvancedContent fields content get deleted when editing page

Posted: Fri Sep 24, 2010 7:06 pm
by Milhaus
Bump. Do you need more info? Perhaps I should have add, that I am using the latest versions of both modules.

Re: AdvancedContent fields content get deleted when editing page

Posted: Sat Sep 25, 2010 10:10 pm
by NaN
Do you use whitespaces or special chars (UTF8 chars) in the blocknames?

Is the content really deleted?
Please take a look in the database (table content_props, order by id) and make sure the content of all the content properties is there.

Re: AdvancedContent fields content get deleted when editing page

Posted: Sun Sep 26, 2010 11:19 am
by Milhaus
Thanks for your suggestions! I finally got it working.

First, I didn't observed any difference between using block names with whitespaces and without them. I didn't used any non-ASCII characters.

And second, the content wasn't deleted, indeed. But I wasn't aware, that when I am saving that block a new block is created in the background, named block_name_cs (or code of whatever language defined in MLE) and content in saved in that one. So when I modified the code in template accordingly, it strated to work.

So, please ,add something like this in the help page of the next version:

CMSMadeSimple Multilingual (MLE)
If you are using CMSMadeSimple Multilingual (MLE), keep in mind, that you need to add language suffix (look for calue of DB block in MLE administration interface) to the block parameter, like this:

Code: Select all

{content block="your_block_name_en"}
or

Code: Select all

{content block="your_block_name_fr"}
Otherwise, the interface for editing pages won't work properly (saved values won't be displayed).

Re: [SOLVED] AdvancedContent fields content get deleted when editing page

Posted: Sun Sep 26, 2010 12:39 pm
by NaN
Well, this should not be needed.
I thought i fixed this already.
It doesn't make much sense if the user needs to apply the language by himself.
This would make MLE useless.
The purpose of MLE is to show content in the selected language no matter what language it is. So the user does not need to specify a certain language in template.

I will do some investigation why AdvancedContent does not load the right language block.

Re: [SOLVED] AdvancedContent fields content get deleted when editing page

Posted: Sun Sep 26, 2010 2:43 pm
by Milhaus
I think it might make sense, if there will be need for different fields in different languages. For example, I can imagine a website with one main language variant with many fields and several other, with one one, say, Summary. Perhaps there should be possibility to adjust this behaviour in the settings of AdvancedContent.

Re: AdvancedContent fields content get deleted when editing page

Posted: Sun Sep 26, 2010 3:45 pm
by Milhaus
OK, this isn't solved at all, because _cs (or _en) is added each time, when saving. So it's completely unusable. Sorry for false report.

Re: AdvancedContent fields content get deleted when editing page

Posted: Sun Sep 26, 2010 4:56 pm
by NaN
I noticed a typo error in AdvancedContent/inc/function.displayContentBlocks.php in line 67.
There i says

Code: Select all


if($this->mle && !$this->blockLang != '' && $blockInfo['block_id'] != 'content' . $this->blockLang)

but it should be

Code: Select all


if($this->mle && $this->blockLang != '' && $blockInfo['block_id'] != 'content' . $this->blockLang)

(without the ! bfore $this->blockLang != '')

But i'm not sure if this caused the error.

Re: AdvancedContent fields content get deleted when editing page

Posted: Sun Sep 26, 2010 7:50 pm
by Milhaus
Thanks a lot! It seems to be working. But I will test it further and will let you know, if anything breaks.

EDIT: Well, I think I can say it more confidently now. So I am marking it as SOLVED for a second time.