We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

NSM Save Draft Problems

Development and Programming

davidlogan's avatar
davidlogan
37 posts
16 years ago
davidlogan's avatar davidlogan

Hi there

We recently purchased NSM plugin for a project.

We are having problems with the save draft functionality. If we save a draft with changes, for instance it was draft 10 and then load up draft 9 without the changes then load up draft 10 again the changes are not there and lost.

Also when you save a draft with changes and go to another section on the CMS and go back to edit the article all changes in the draft are lost again.

And all drafts are exactly the same, if you save a revision it overwrites every draft!

Am I missing something here? Because it’s either a massive oversight by me or the drafts aren’t working at all.

Just a small of an outline of the site, we are running multi-site manager running 4.

We are desperate to sort this as our client is very frustrated.

Jonny

       
IRIS_HQ's avatar
IRIS_HQ
8 posts
16 years ago
IRIS_HQ's avatar IRIS_HQ

Hi,

I’m having the same problem. I’ve installed NSM Publish Plus with no problems on a previous site, but have the same exact problem this time. Drafts don’t seem to save when you navigate away from the publish screen. They also don’t work at all with the URL triggers.

Matt

       
IRIS_HQ's avatar
IRIS_HQ
8 posts
16 years ago
IRIS_HQ's avatar IRIS_HQ

I figured this out. I had incorrectly applied the core hack. I had

if (is_numeric($version_id))
        {
            $entry_id = $IN->GBL('entry_id');
            $revquery = $DB->query("SELECT version_data FROM exp_entry_versioning WHERE entry_id = '{$entry_id}' AND version_id = '{$version_id}'");
        
            if ($revquery->num_rows == 1)
            {    
                $_POST = $REGX->array_stripslashes(@unserialize($revquery->row['version_data']));
                $_POST['entry_id'] = $entry_id;
                $which = 'preview';
            }
            unset($revquery);
            
            if (is_numeric($IN->GBL("draft_id")))
            {
                $which = 'preview';
            }

It should be

if (is_numeric($version_id))
        {
            $entry_id = $IN->GBL('entry_id');
            $revquery = $DB->query("SELECT version_data FROM exp_entry_versioning WHERE entry_id = '{$entry_id}' AND version_id = '{$version_id}'");
        
            if ($revquery->num_rows == 1)
            {    
                $_POST = $REGX->array_stripslashes(@unserialize($revquery->row['version_data']));
                $_POST['entry_id'] = $entry_id;
                $which = 'preview';
            }
            unset($revquery);
        }
        
        if (is_numeric($IN->GBL("draft_id")))
        {
            $which = 'preview';
        }

Make sure your brackets close before where you paste in the core hack.

       
davidlogan's avatar
davidlogan
37 posts
16 years ago
davidlogan's avatar davidlogan

F**king brilliant. That’s solved the problem.

Thanks very much, If your anywhere near manchester UK we owe you a few beers!!!!

       
IRIS_HQ's avatar
IRIS_HQ
8 posts
16 years ago
IRIS_HQ's avatar IRIS_HQ

I would take you up on the beers but I’m in Washington, DC. Take it easy.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.