Content_Block losing content after upgrade to 2.2.1

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
smithdesign77
Forum Members
Forum Members
Posts: 25
Joined: Mon Jan 02, 2017 10:27 pm

Content_Block losing content after upgrade to 2.2.1

Post by smithdesign77 »

Maybe it's just me, however, I have following strange behaviour:
I upgraded from 2.1.6. to 2.2.1; had a fine, working page with basically no extra plugins or modules (just FormBuilder).
However, I do use a number of content blocks and have them assiged first like:

Code: Select all

{content block='Technische Daten Rot' tab='Technische Daten' Label='Technische Daten Rot' assign='techred'}
and later in the template

Code: Select all

{if ($techred!='')}{$techred}{/if}
Directly after upgrade everything is fine, all content is there.

Now I wanted to change some text in the main content area of a page, applied the change (contents of that extra blocks were totally fine displayed in Tiny) and found that the contents from the extra content blocks were now suddently 'missing'? Actually, it writes "0", literally. In the Tiny as also on the front end.

In the database the contents still is there. Where am I going wrong? Typo in the template perhaps? There are no umlauts or such ... perhaps the whitespaces(?) - but, that's only the Label...

All right; never mind.
The whitespaces in the block='' were the issue, as far I can see right now. At least new updates are beeing saved and remain. For some reason I had no problems with that in 2.1.6.

I'll just leave this post here for other guys running into these kind of problems: Check first if you use umlauts or other t¥pó you didn't think of - like whitespaces. ;D
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Content_Block losing content after upgrade to 2.2.1

Post by velden »

I think it would make sense to NEVER use spaces and 'weird' characters for variable names, aliasses, block names, template names, stylesheets etc etc. Many programming languages and systems don't allow it for their 'entities'.

And in this case the 'label' property allows you to display a nice message for the editors.
smithdesign77
Forum Members
Forum Members
Posts: 25
Joined: Mon Jan 02, 2017 10:27 pm

Re: Content_Block losing content after upgrade to 2.2.1

Post by smithdesign77 »

True.
However, this discipline of web design challenges us in two quite total different worlds: art/design and programming.

I'm not one of those guys who constantly keeps saying 'designer, not coder' - but yes, designing is a lot easier for me. So when it comes to coding I go with try&error and over the years could manage to do a lot of things I hadn't even imagined earlier. When there is an error during the design process I do triple check my code, of course.
Meanwhile I figured out things like that I tend to forget ")" after my if-condition and similar stuff. I try to work against that with habits like writing the complete logic first: "{if ()} {else} {/if}" and just then adding the conditions and the HTML I'd like to have inbetween.

It is neither a silly thing nor stupidity to put disallowed entities in the wrong places - it's just: I sometimes just can't get it into my mind. I tried reading documentations like for HTML5, but failed so badly - I can't even concentrate long enough to comprehense one single written page at once ... but I can draw a full day straight and do all kinds of other creative (yet also same exhausting as coding) stuff for hours and hours and hours... ;D

So when it comes to code, I copy&paste, read and check from other sites and tutorials and once in a while google some single bits, like "what is <article>" to see if that fits into my project.
Sorry, but that's me... ¯\_(ツ)_/¯
scooper
Forum Members
Forum Members
Posts: 242
Joined: Fri Dec 09, 2005 12:36 pm
Location: Marlow, UK

Re: Content_Block losing content after upgrade to 2.2.1

Post by scooper »

Just as a quick addendum because I've just had the same problem - the content props in the database seem to have the block names with underscores instead of space anyway, so if you replace your spaces with underscores in the tag then it should pull in any content correctly without losing anything you've previously entered.

So something like:

Code: Select all

{content block='Technische Daten Rot' }
to
{content block='Technische_Daten_Rot' }
xynergy
New Member
New Member
Posts: 4
Joined: Fri Jul 14, 2017 7:29 pm

Re: Content_Block losing content after upgrade to 2.2.1

Post by xynergy »

@scooper - thanks for this! I was having the exact same problem so this should help a lot. Glad to hear I don't have to manually move any content!
Locked

Return to “[locked] Installation, Setup and Upgrade”