[SOLVED] AdvancedContent fields content get deleted when editing page

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
Milhaus

[SOLVED] AdvancedContent fields content get deleted when editing page

Post 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?
Last edited by Milhaus on Sun Sep 26, 2010 9:12 pm, edited 1 time in total.
Milhaus

Re: AdvancedContent fields content get deleted when editing page

Post by Milhaus »

Bump. Do you need more info? Perhaps I should have add, that I am using the latest versions of both modules.
NaN

Re: AdvancedContent fields content get deleted when editing page

Post 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.
Milhaus

Re: AdvancedContent fields content get deleted when editing page

Post 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).
NaN

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

Post 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.
Milhaus

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

Post 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.
Milhaus

Re: AdvancedContent fields content get deleted when editing page

Post 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.
NaN

Re: AdvancedContent fields content get deleted when editing page

Post 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.
Milhaus

Re: AdvancedContent fields content get deleted when editing page

Post 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.
Last edited by Milhaus on Sun Sep 26, 2010 9:12 pm, edited 1 time in total.
Locked

Return to “[locked] CMSMS MLE fork”