Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fengelz 106 posts 221 karma points
    Mar 14, 2014 @ 12:50
    Fengelz
    0

    Using the Macro Container in 7.0.4

    Hi.
    Just started working on my first Umbraco 7 site, and like it so far.

    I am trying to use the Macro Container datatype, but get the old red "Server error: Contact administrator, see log for full details. String or binary data would be truncated. The statement has been terminated.".

    In the older Umbraco versions I would check the databasetype of the datatype and set it to Ntext. I am not presented with the option of choosing databasetype in version 7 though? Is this on purpose? Do you define the database type another place?

    Anywho the Macro container would suit me really good for this particular datatype, so if anybody have an idea how to fix this, it would be most welcome.

    Cheers

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 14, 2014 @ 13:10
    Jan Skovgaard
    0

    Hi Fengelz

    It may or may not be a bug...however could you have a look in the /app_data/logs folder and see if there is written som details of interenst into the log file?

    /Jan

  • Fengelz 106 posts 221 karma points
    Mar 14, 2014 @ 13:52
    Fengelz
    0

    Hi Jan. Thanks for the quick reply.

    I dont have access to the server at the moment, only the backoffice. But I installed the Log Manager package and it only says "14/03/2014 13:47:29 Save and Publish performed by user"

    But do you know if the databasetype selector is supposed to be visible in the new Umbraco or if there is another way of handling it now?

    Cheers
    - Sune

  • Fengelz 106 posts 221 karma points
    Mar 17, 2014 @ 11:54
    Fengelz
    102

    Ok. I solved this today.

    I got access to the server and changed the Umbraco.MacroContainer datatype from VARCHAR to Ntext in the table CMSDatatype.

    But still I would think that the datatype editor needs the databasetype dropdown for future updates.

    - Sune

     

  • Mike 62 posts 274 karma points
    Oct 02, 2014 @ 21:45
    Mike
    0

    Hey Sune, 

    Where specifically did you find the Umbraco.MacroContainer datatype to change this? I'm having the exact same issue in Umbraco 7.1.6

    Many thanks,
    Mike 

  • John B 1 post 21 karma points
    Oct 13, 2014 @ 16:18
    John B
    0

    Mike, this is the SQL you're looking for:

    update cmsDataType
    set dbType = 'Ntext'
    where propertyEditorAlias = 'Umbraco.MacroContainer'

    I was looking in this area, but I have to thank Fenqelz for the solution.

    I don't know if you have already done this, but the upgrade from 6 to 7 also set the "property editor" of all my macros to "Label" which means they can't be updated proerly in the conetent view. I had to go to the Developer / Data Types and set the "property editor" of my types back to "Macro container".

    I also found that the text defining my macros in the content contained double spaces and this was preventing the macros from working. (E.g. after the word "UMBRACO_MACRO"):

     

    This was resulting in the content property editor looking something like this (there are 8 macros, but clearly not parsed correctly):

    These double spaces existed in the database before the upgrade, but were obviously handled by the macro renderer. To fix, I ran the following script:

    update [dbo].[cmsPropertyData]
    set dataNtext = convert(ntext, replace(convert(nvarchar(max), dataNtext), ' ', ' '))
    where dataNtext like '%UMBRACO_MACRO%';

     You might need to be more careful with your where clause than I was.

Please Sign in or register to post replies

Write your reply to:

Draft