We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36549
    • 572 Posts
    Hi,

    I want to use a front end solution so that logged in web users have the ability to drag/drop files (Word docs) in to a page, much like the way Google Docs works.
    Can this be done solely with NewsPublisher?
    I have found an extra called Asset Manager which provides drag/drop functionality in the Manager so perhaps the two could work together?

    Anyway my next question is about NewsPublisher which i have mostly working except for an error message on an existing page i want to be editable. The error is:
    NO RESOURCE SAVE PERMISSION ON THIS DOCUMENT

    Clicking on the above does take me to the NP page but i am unable to save.
    I am logged in as a MEMBER with ACL including 'save resource' and 'basic save permission'
    The page in question is assigned to the MEMBERS RESOURCE GROUP. The Template contains this:
    [[!NpEditThisButton? &debug=`1`]]


    Modx 2.5.8

    Thanks for any help

    This question has been answered by BobRay. See the first response.

      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 3749
      • 24,544 Posts
      On your first question, I would say no, but I've never actually tried it. Are you expecting that the content of the Word docs will be converted to HTML and inserted, or are you just adding a link to then? The link might work with Asset Manager, but nothing in NP will translate Word docs to HTML.


      On your permission issue, are you viewing from the Manager? If so, you need to log in again in the front end.

      If you *are* logged in the front end, be sure the Policy attached to the Resource Access ACL entry has 'save' permission checked. It's necessary in addition to the Context save_document permission.
        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
        • 36549
        • 572 Posts
        Thank you for your input BobRay.
        I have set it up on another website and have the Edit button working now.
        I think the functionality initially wanted, as described above was a little ambitious. However a drag/drop functionality for Word documents is still wanted but this can be translated to a download link upon upload - if possible?

        One thing I can't get to work in NP is the RTE.
        I copied your example code and then pared it down but either way I got an error page:
         Fatal error: Call to a member function addJavascript() on null in /home/wwwnight/public_html/core/components/tinymce/tinymce.class.php on line 151

        Line 151 is:
        $this->modx->controller->addJavascript($this->config['assetsUrl'].'jscripts/tiny_mce/'.$scriptFile);

        If I removed &initrte=`1` property I then got two errors on the page:
        The &initrte parameter is not set, but you asked for this richtext field: introtext
        The &initrte parameter is not set, but you asked for this richtext field: content

        I then found the '&initrte' setting in the Snippets Property tab so enabled this but now I consistently get the above error even when the call is simply: [[!NewsPublisher]]

        I have cleared cache, flushed permissions and logged in/out a few times but the error persists.

        Any idea how to fix this?

        Thanks

        Janice

          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 3749
          • 24,544 Posts
          That error is coming from the MODX TinyMCE extra, not from NewsPublisher, or from the TinyMCE class that NewsPublisher uses.

          Do you have the current version of NewsPublisher? It has a whole new version of TinyMCE loaded via CDN to avoid that problem. It doesn't use the MODX TinyMCE extra at all.

          It could also be an issue if you are logged into the Manager while trying to use NP in the front end.

            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
            • 36549
            • 572 Posts
            Thanks Bobray.
            I reinstalled NP and I've retested a page to edit which works as suspected.
            I still can't get the RTE to show though.
            When i add the following i get that error referring to line 151:
            [[!NewsPublisher?
                    &initrte=`1`
                    &initdatepicker=`1`
                    &initfilebrowser=`1`
                    &rtcontent=`1`
            ]]

            If i remove the &initrte and refresh the page i get the following error:
            The &initrte parameter is not set, but you asked for this richtext field: content

            I also get that 'line 151' error when i enable the initrte and initfilebrowser in the plugin properties.
            Any idea what the issue might be?
            Thanks
              www.9thwave.co.uk
                 WEB | DESIGN | PRINT
              • 42562
              • 1,145 Posts
              I would clean out that installation, every trace of it on the server, and reinstall.
                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.
                • 36549
                • 572 Posts
                I just installed NewsPublisher on a new site and whenever I add the &initrte=`1` to the NP snippet I get the same error:
                 Fatal error: Call to a member function addJavascript() on null in /home/www/public_html/core/components/tinymce/tinymce.class.php on line 151


                I'll try on one more site.
                  www.9thwave.co.uk
                     WEB | DESIGN | PRINT
                  • 36549
                  • 572 Posts
                  Hello,

                  Only just got back to this site and the error persists.
                  I'm using NewsPublisher 3.0.4 and TinyMCE 4.3.4 and Modx 2.6.0
                  There are a couple of errors in the error log but none that seem to pertain to these two extras.
                  It's the &initrte=`1` that is causing the error as posted above.
                  Any ideas?
                  Thanks very much



                    www.9thwave.co.uk
                       WEB | DESIGN | PRINT
                    • 3749
                    • 24,544 Posts
                    Are you sure you have the current version of NP? It was re-written to fix that specific error.

                    Are you trying from another browser where you're not logged in to the Manager?

                    The current Version of NewsPublisherloads TinyMCE from CDN, so it doesn't use the TinyMCE extra at all -- and it never calls AddJavaScript(), though the old TinyMCE extra does. If you're going to the NP page from the Manager, and you use the TinyMCE extra in the Manager, the two might conflict. If it doesn't happen in another browser, that's probably the issue.

                    If it *does* happen from another browser and you need TinyMCE in the Manager it might work to remove your TinyMCE extra completely and trying donshakespeare's TinyMCEWrapper extra.
                      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
                      • 36549
                      • 572 Posts
                      Quote from: BobRay at Jun 20, 2018, 02:47 AM
                      Are you sure you have the current version of NP? It was re-written to fix that specific error.

                      Are you trying from another browser where you're not logged in to the Manager?

                      The current Version of NewsPublisherloads TinyMCE from CDN, so it doesn't use the TinyMCE extra at all -- and it never calls AddJavaScript(), though the old TinyMCE extra does. If you're going to the NP page from the Manager, and you use the TinyMCE extra in the Manager, the two might conflict. If it doesn't happen in another browser, that's probably the issue.

                      If it *does* happen from another browser and you need TinyMCE in the Manager it might work to remove your TinyMCE extra completely and trying donshakespeare's TinyMCEWrapper extra.

                      I've tried in the same browser i'm logged into as 'sudo' user and also a different browser logged into as a lower usergroup.

                      I have followed your suggestion by uninstalling TinyMCE (I have actually removed it and cleared the cache although the plugin is still in the Elements tab) and installing TinymceWrapper and now get the following error when accessing any resource:
                      Fatal error: require_once(): Failed opening required '/home/wwwnight/public_html/core/components/tinymce/tinymce.class.php' (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/wwwnight/public_html/core/cache/includes/elements/modplugin/9.include.cache.php on line 21
                      [ed. note: 9thwave last edited this post 5 years, 10 months ago.]
                        www.9thwave.co.uk
                           WEB | DESIGN | PRINT