We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24374
    • 322 Posts
    Quote from: rainbowtiger at Dec 01, 2017, 04:47 AM
    Quote from: BobRay at Dec 01, 2017, 02:23 AM
    OK, but what is the context_key of the resource set to? I doubt if it's 'mgr' and that's the context that's trying to find the resource.

    It's "web", same as all other resources.
    Well, I upgraded the 2.5.5 site to 2.5.8, and the errors all went away. The 2.6.0 site still has lots of errors.
      • 36760
      • 136 Posts
      I'm on Modx 2.6.0 with TinyMCEWrapper 2.3.2.

      I'm trying to setup a custom dialog that gets populated based on the selected text, similar to how you can "edit" an image that's already been placed. I'm pretty sure my issue is purely javascript/jquery related, but I figured I'd ask here anyway in case someone else is looking to do this in the future. I'm also open to any better ways to do this, but I couldn't find anything TinyMCE specific when searching around.

      This is my full plugin javascript.
      tinymce.PluginManager.add('doDontBox', function(editor, url) {
        // Add a button that opens a window
        editor.addButton('doDontBox', {
          text: "Do Don't Box",
          icon: false,
          onclick: function() {
      		var selectedContent = editor.selection.getContent();
      		var errorText = '';
      		var textDo = '';
      		
      		if (selectedContent.indexOf('&do=') >= 0 && selectedContent.indexOf('&dont=') >= 0 && selectedContent.indexOf('&summary=') >= 0){
      			errorText = 'All present.';
      			textDo = selectedContent.match('do=\\`(.*)\\`');
      			//textDo = selectedContent.match('do(.*)do');
      			console.log(textDo);
      			
      		}else if(selectedContent.indexOf('&do=') >= 0 || selectedContent.indexOf('&dont=') >= 0 || selectedContent.indexOf('&summary=') >= 0){
      			errorText = 'Not all present.';
      		}else{
      			errorText = 'Nothing present.';
      		}
      			
      		// Open window
      		editor.windowManager.open({
      			title: "Do Don't Box",
      			body: [
      				{type: 'label', name: 'erorrText', text: errorText},
      				{type: 'textbox', multiline: true, name: 'textDo', label: 'Do', value: textDo},
      				{type: 'textbox', multiline: true, name: 'title', label: 'Title', value: selectedContent},
      				{type: 'textbox', multiline: true, name: 'title', label: 'Title', value: selectedContent}
      			],
      			onsubmit: function(e) {
      				// Insert content when the window form is submitted
      				editor.insertContent('Title: ' + e.data.title);
      			}
          });
          }
        });
      });


      This is the snippet code I'm trying to pull data from when selected. I'm posting the raw HTML Modx ends up wrapping it in, in case that's what's causing issues. The snippet itself is working as expected.
      <p>[[!doDontBox? &title=`Title` &titleTag=`h4` &do=`</p>
      <ul>
      <li>Line 1</li>
      <li>Line 2</li>
      <li>Some more lines</li>
      </ul>
      <p>` &dont=`</p>
      <ul>
      <li>Line 1</li>
      <li>Line 2</li>
      <li>Some more lines</li>
      </ul>
      <p>` &summary=`</p>
      <p>Some summary stuff!</p>
      <p>`]]</p>


      The problem area is textDo = selectedContent.match('do=\\`(.*)\\`');. It doesn't return anything, and I can't figure out what's wrong with the code. I want to return everything inside the &do=`` parameter. I've tried escaping and not escaping various characters, with no luck.

      If I use textDo = selectedContent.match('do(.*)do');, I get back doDontBox? &title=`Title` &titleTag=`h4` &do,DontBox? &title=`Title` &titleTag=`h4` &, so there's something wrong when I start adding special characters.

      I appreciate any help!
        • 3749
        • 24,544 Posts
        FWIW, PhpStorm doesn't report any problems with the JS code other than noting that the url parameter is never used.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 8898
          • 181 Posts
          I just tried to install TinymceWrapper in a Vagrant box I got from a customer (a web design studio). It comes with MySQL 5.7, which has the strict mode applied (default setting since MySQL 5.7). Therefore several of the TinymceWrapper descriptions which are longer than the description fields in the site_snippets,
          site_htmlsnippets, site_templates, site_plugins, and site_content tables (all varchar fields with a length of 191 characters) cause errors during the installation process: "Data too long for column 'description' at row 1".

          When the MySQL strict mode isn't active, the descriptions are cut off, anyway. Would you mind shortening them so they fit in the description fields and don't cause errors in some cases?

          Thank you very much in advance!
            This message has been ROT-13 encrypted twice for higher security.
            • 24374
            • 322 Posts
            After upgrading to MODX 2.6.1., the modxNativeBrowserQuirkMode has stopped working. With this enabled, the bottom buttons show up as expected, but nothing works. I really want those buttons!
              • 42562
              • 1,145 Posts
              @firebot6
              Before the match command, tried to see what is textDo's value?
              console.log(textDo); //BE SAFE .. ADD THIS LINE
              textDo = selectedContent.match('do=\\`(.*)\\`');
              //textDo = selectedContent.match('do(.*)do');
              console.log(textDo);


              @enigmatic_user
              You mean the resource description field?
              Done!
              No resource in 3.0 even


              @rainbowtiger
              I'll send you a fix
                TinymceWrapper: Complete back/frontend content solution.
                Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • 8898
                • 181 Posts
                Quote from: donshakespeare at Mar 16, 2018, 12:25 AM
                @enigmatic_user
                You mean the resource description field?
                Done!
                No resource in 3.0 even

                I meant the descriptions for resources, templates, chunks, snippets, and the plugin that come with TinymceWrapper.
                  This message has been ROT-13 encrypted twice for higher security.
                  • 42562
                  • 1,145 Posts
                  @enigmatic_user
                  Okay thanks for clarifying.
                  Please log this in repos github page so that I can remember to look into it.
                    TinymceWrapper: Complete back/frontend content solution.
                    Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                    5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                    • 8898
                    • 181 Posts
                    Quote from: donshakespeare at Mar 16, 2018, 07:41 AM
                    Please log this in repos github page so that I can remember to look into it.
                    Done.
                      This message has been ROT-13 encrypted twice for higher security.
                      • 40088
                      • 708 Posts
                      Revo 2.6.2
                      TW 2.3.2

                      RFM (file manager) works fine for the Administrator user-group but for my "Member" user-group it opens but is blank with the message "Unable to create/open file."

                      I'm certain the relevent psets (RFM, TMP, TW) are configured correctly so it must be an ACL issue. If anyone has RFM working correctly for a non-admin user-group could you share your ACL settings and/or Access Policies?

                      I'm losing my mind trying to sort this out.
                        Todd