We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22840
    • 1,572 Posts
    Server status for this from cpanel is as follous:

    Kernel version 2.6.18-164.15.1.el5
    cPanel Version 11.25.0-RELEASE
    Shared Ip Address 78.143.252.33
    Architecture i686
    MySQL version 5.0.91-community
    cPanel Build 46156
    Path to sendmail /usr/sbin/sendmail
    Apache version 2.2.15
    PHP version 5.2.13
    cPanel Pro 1.0 (RC1)
    Service Status Click to View

    If any mod needs access to my server, cpanel, WHM or anything else please ask as I really need this sorting.

    Thanks
      • 28215
      • 4,149 Posts
      Ensure your TV doesnt have a default value of "\n". You may need to look in the DB to do this.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 22840
        • 1,572 Posts
        Hi Shaun,

        What table would I look in ??

        Thanks for replying
          • 28215
          • 4,149 Posts
          modx_site_tmplvars
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 22840
            • 1,572 Posts
            Hi Shaun,

            Thanks again for looking into this.

            As explained above I have 1 image TV assigned to my locations template and that shows the upload dropdown.

            If I create another and assign it to another template ( in this case my sites template ) all I get is the name and description with no dropdown to select.

            database tables for thew TV’s below.

              • 8869
              • 32 Posts
              I have found the source of the problem

              When I create a new image template variable it is setting the default_text field in the modx_site_tmplvars table to ’\n’

              As can be seen here:

              --
              -- Dumping data for table `modx_site_tmplvars`
              --
              
              INSERT INTO `modx_site_tmplvars` (`id`, `type`, `name`, `caption`, `description`, `editor_type`, `category`, `locked`, `elements`, `rank`, `display`, `display_params`, `default_text`, `properties`) VALUES
              (7, 'image', 'Picture Placeholder', 'Picture Placeholder', '', 0, 0, 0, '', 0, 'image', '&alttext=&hspace=&vspace=&borsize=&align=none&name=&class=&id=&style=&attributes=', '', 'a:0:{}'),
              (2, 'richtext', 'Text Place Holder 1', 'First Text Block', '', 0, 0, 0, '', 0, 'richtext', '&w=100%&h=300px', '\n', 'a:0:{}'),
              (3, 'tag', 'Meta Tags', 'Choose search keywords relavant to page', 'HTML Meta Tags', 0, 0, 0, 'food||results||press||animal welfare||chicken||2 Sisters food group', 0, 'htmltag', '&tagname=search_meta&tagid=&class=&style=&attrib=', '\n', 'a:0:{}'),
              (8, 'image', 'image2', 'image2', 'image2', 0, 0, 0, '1', 0, 'image', '&alttext=1&hspace=&vspace=&borsize=&align=none&name=sdffd&class=&id=&style=&attributes=', '\n', 'a:0:{}'),
              (5, 'richtext', 'Second Text Block', 'Second Text Block', '', 0, 0, 0, '', 0, 'richtext', '&w=100%&h=300px', '\n', 'a:0:{}'),
              (6, 'autotag', 'Autotag', 'Autotag', '', 0, 0, 0, '', 0, 'htmltag', '&tagname=div&tagid=&class=&style=&attrib=', '\n', 'a:0:{}');
              


              Here I have manually fixed "Picture Placeholder" TV and it displays correctly

              However the newly created "image2" is not showing correctly

              Manually altering the database fixes the issue

              So in summary a change needs to be made to make sure ’\n’ isn’t put in the deafult_text field when first creating a TV

              I haven’t used any import method to create this new troubleome TV - it has purely been created from with the functionality of the manager screen
                • 10107
                • 24 Posts
                Well I have the exact same issue but when I set up the TV and gave a template access it worked fine, now I have created another template which needs to use the same TV and then I click on the Template Variables tab I get the TV text but no image chooser. I checked the DB and there is no default value for the TV.

                I’m running MAMP on my iMac
                PHP 5.2.13
                MySQL 5.1.44

                UPDATE: Ok so dumped the site_templatevars table as above and saw the ’\n’ output so I went into the DB and changed the default value of the TV in question to a single space and that fixed it
                  • 22840
                  • 1,572 Posts
                  Quote from: en8scl at Aug 09, 2010, 05:24 PM

                  I have found the source of the problem

                  When I create a new image template variable it is setting the default_text field in the modx_site_tmplvars table to ’\n’

                  As can be seen here:

                  --
                  -- Dumping data for table `modx_site_tmplvars`
                  --
                  
                  INSERT INTO `modx_site_tmplvars` (`id`, `type`, `name`, `caption`, `description`, `editor_type`, `category`, `locked`, `elements`, `rank`, `display`, `display_params`, `default_text`, `properties`) VALUES
                  (7, 'image', 'Picture Placeholder', 'Picture Placeholder', '', 0, 0, 0, '', 0, 'image', '&alttext=&hspace=&vspace=&borsize=&align=none&name=&class=&id=&style=&attributes=', '', 'a:0:{}'),
                  (2, 'richtext', 'Text Place Holder 1', 'First Text Block', '', 0, 0, 0, '', 0, 'richtext', '&w=100%&h=300px', '\n', 'a:0:{}'),
                  (3, 'tag', 'Meta Tags', 'Choose search keywords relavant to page', 'HTML Meta Tags', 0, 0, 0, 'food||results||press||animal welfare||chicken||2 Sisters food group', 0, 'htmltag', '&tagname=search_meta&tagid=&class=&style=&attrib=', '\n', 'a:0:{}'),
                  (8, 'image', 'image2', 'image2', 'image2', 0, 0, 0, '1', 0, 'image', '&alttext=1&hspace=&vspace=&borsize=&align=none&name=sdffd&class=&id=&style=&attributes=', '\n', 'a:0:{}'),
                  (5, 'richtext', 'Second Text Block', 'Second Text Block', '', 0, 0, 0, '', 0, 'richtext', '&w=100%&h=300px', '\n', 'a:0:{}'),
                  (6, 'autotag', 'Autotag', 'Autotag', '', 0, 0, 0, '', 0, 'htmltag', '&tagname=div&tagid=&class=&style=&attrib=', '\n', 'a:0:{}');
                  


                  Here I have manually fixed "Picture Placeholder" TV and it displays correctly

                  However the newly created "image2" is not showing correctly

                  Manually altering the database fixes the issue

                  So in summary a change needs to be made to make sure ’\n’ isn’t put in the deafult_text field when first creating a TV

                  I haven’t used any import method to create this new troubleome TV - it has purely been created from with the functionality of the manager screen

                  That’s brilliant and works like a charm.

                  Thank you
                    • 10169
                    • 24 Posts
                    I just ran into this problem myself, and the database edit solution worked. I’m running a clean copy of Revo pl installed via Simple Scripts on Bluehost.

                    So, is the workaround for now to always give a new TV a default value when creating it?

                    -Mike
                      • 33337
                      • 3,975 Posts
                      Zaigham (aka zi) Reply #50, 16 years ago
                      I think its CodeMirorr plugin adding /n into it when creating a new TV.

                      I have just tried with and without CodeMirror plugin, upon disabling the plugin it works ok.

                      So, immediate solution is to disable the CodeMirror plugin when creating galleryitem Image tvs.
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link