We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4806
    • 0 Posts
    I have Revolution 2.1.1-pl installed on a hosted machine.

    I’m making progress in setting up the site I want to use MODx for, but I’m having difficulty with Template Variables.

    I’ve created a few, and some work as expected, but others don’t allow me to enter any content in them.

    For example:

    I’ve just created a Template variable called iframecontent. It’s to hold the URL for an embedded Google map, so I’ve set it up as Input Type URL, and Output Type URL. I’ve granted access to the page template that I want to use it in, and all the other properties are set to their default value (i.e. largely empty).

    The Template references the TV thus:

    <div style="text-align:center;">
    <iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="[[*iframecontent]]&output=embed"></iframe><br /><small>View <a href="[[*iframecontent]]&source=embed" style="color:#0000FF;text-align:left">location</a> in a larger map</small></div>
    


    My problem is that when I edit a document which has this template, and enter a value in the TV, MODx Manager will not save the page. If I edit any other part of the document, including the standard content field, it saves just fine.

    I can see using Firebug in Firefox that I am getting a 404 error from /connectors/resource/index.php. However a save from the page without entering a value for the TV results in a 200 status from the same page.

    This is the data from the successful post:

    id	4
    template	4
    published	1
    pagetitle	Contact Us
    longtitle	
    description	
    alias	contactus
    link_attributes	
    introtext	
    parent-cmb	
    parent	0
    parent-original	0
    menutitle	
    menuindex	1
    hidemenu	0
    type	document
    context_key	web
    content	<p>[removed]</p> 
    create-resource-token	
    isfolder	0
    richtext	1
    publishedon	2011-05-31 22:30:00
    pub_date	
    unpub_date	
    searchable	1
    cacheable	1
    syncsite	1
    deleted	0
    content_type	1
    content_dispo	0
    class_key	modDocument
    uri_override	0
    uri	contactus.html
    tvs	1
    tv6_prefix	--
    tv6	
    ext-comp-1031	20
    ta	<p>[removed]</p> 
    action	update
    modx-ab-stay	
    resource_groups	{}
    HTTP_MODAUTH	modx4dee7d5b14fa19.00621213_14dee9cdce28696.77686471
    


    The response that comes back is AJAX:

    {"success":true,"message":"","total":0,"data":[],"object":{"id":4,"type":"document","contentType":"text\/html","alias":"contactus","published":true,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":false,"richtext":true,"template":4,"menuindex":1,"searchable":true,"cacheable":true,"createdby":1,"createdon":"2011-05-31 21:20:41","editedby":1,"editedon":"2011-06-07 23:20:20","deleted":false,"deletedon":0,"deletedby":0,"publishedon":"2011-05-31 22:30:00","publishedby":1,"donthit":false,"privateweb":false,"privatemgr":false,"content_dispo":0,"hidemenu":false,"class_key":"modDocument","context_key":"web","content_type":1,"uri":"contactus.html","uri_override":0,"parent-cmb":"","parent-original":"0","create-resource-token":"","syncsite":1,"ext-comp-1031":"20","action":"update","modx-ab-stay":"","resource_groups":"{}","HTTP_MODAUTH":"modx4dee7d5b14fa19.00621213_14dee9cdce28696.77686471","preview_url":"[removed]"}}
    


    This is from the unsuccessful post:

    id	4
    template	4
    published	1
    pagetitle	Contact Us
    longtitle	
    description	
    alias	contactus
    link_attributes	
    introtext	
    parent-cmb	
    parent	0
    parent-original	0
    menutitle	
    menuindex	1
    hidemenu	0
    type	document
    context_key	web
    content	<p>[removed]</p>
    create-resource-token	
    isfolder	0
    richtext	1
    publishedon	2011-05-31 22:30:00
    pub_date	
    unpub_date	
    searchable	1
    cacheable	1
    syncsite	1
    deleted	0
    content_type	1
    content_dispo	0
    class_key	modDocument
    uri_override	0
    uri	contactus.html
    tvs	1
    tv6_prefix	http://
    tv6	
    ext-comp-1031	20
    ta	<p>[removed]</p>
    action	update
    modx-ab-stay	
    resource_groups	{}
    HTTP_MODAUTH	modx4dee7d5b14fa19.00621213_14dee9cdce28696.77686471
    


    (I know no value is present in tv6, i’ve tried entering various values including none, and all result in the same state)

    The response is the 404, followed by the HTML from the homepage of the site. This causes the manager to hang on the "Please Wait... Saving..." message. A refresh of the browser returns me to the previous version of the page.

    I have friendly URLs enabled, in case it makes a difference, and the formit, gallery, TinyMCE and Wayfinder packages installed (all latest versions).

    I’ve searched Google and these forums and can find no reference to anyone else with the problem, so I’m guessing it’s something to do with my installation (which was done using Softaculous from CPanel from the web hosting company), but I’m stumped as to what to look for. There are no errors in the Manager Actions log, nor in the CPANEL HTTP errors log.

    An example of a TV that does work, is an Image type, which I am able to use to refer to images on the server with success.

    Would very much appreciate some assistance...

    Thanks in advance,

    Chris

    MODx: 2.1.1-pl
    Distribution: Traditional
    Server OS: Linux
    Version: 2.6.18-238.9.1.el5
    PHP: 5.2.14
    MySQL: 5.0.92-community
    PDO driver for MySQL is installed
    Browser: Firefox 4 (Windows 7)
      • 29679
      • 7 Posts
      Bump, I’m having essentially the same problem.

      I’m running 2.1.1 traditional
      LAMP stack (hostgator)
      PHP 5.2
      mySQL 5.1
      PDO’s installed
      In chrome/ffx4/safari on OSX 10.6
      Error logs clean
      Last version before 2.1.1 was 2.0.4, but the upgrade went fine.

      I was attempting to follow the instructions here: http://www.cmslesstraveled.com/index/archive/2011/everythings-a-container.html
      and it seems that the suggested plugin is causing a hangup. If memory serves, this wasn’t a problem in 2.0.4, but I could be mistaken.

      The plugin in question is just one line
      $resource->set('isfolder', 1);​
      , and i’ve tried calling it for both OnBeforeDocFormSave and OnDocFormSave.

      When I try to save a new resource, or make a modification that involves a save (changing the template), it hangs up and the "saving" animation bar loops indefinitely. When I refresh the page, I’m back to a blank slate, since nothing can be saved.

      Disabling the plugin completely resolves the issue, so I’m fairly certain that’s the problem.

      If this way of altering the container status is incorrect for some reason, is there a better way to do it? The site above wants to set everything to a container, but I want to set nothing to be a container. I figured it’d be as simple as set(’isfolder’, 0); but I’ve tried it both his way and mine, both produce the same problem.

      Any insight is appreciated, thanks.

      edit: chrome’s developer console returns this error as soon as I hit "yes" to the template change and the save dialog opens.

      Uncaught SyntaxError: Unexpected token <
      doDecodeext-all.js:7
      (anonymous function)ext-all.js:7
      Ext.override.handleResponsemodext-min.js:21
      Ext.form.Action.processResponseext-all.js:11
      Ext.extend.successext-all.js:11
      oext-all.js:7
      text-all.js:7
      Jext-all.js:7
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        I don’t know if this is a problem on hostgator, but I’ve had issues where Mod-Security (an apache module) puts the smack down on saving and updating operations. If it’s your own VPS, you can check the logs, but maybe ask HostGator just to be sure -- give them your IP address and ask them if they have any security type stuff enabled that might deny a page request. (often the security stuff thinks the page is a MySQL injection attack).
          • 4806
          • 0 Posts
          I’ve just updated to 2.1.2-pl, and the problem is now resolved - "In this update several interface and performance issues have been resolved"; so I guess this was one of them. Thank you grin