Jump to content

ProcessPageDelete


Nico Knoll
 Share

Recommended Posts

  • 1 month later...
  • 5 months later...

Hi Nico, can you make translatable more strings like:

  • Moved page to trash
  • You don't have access to delete that page
  • This module requires ProcessWire 2.1 or newer..

And maybe dont read "delete" translation from /wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module as i want be able to translate it separately.

One more vote for fixing delete behaviour in trash with pernament page delete or hiding delete button.

Thanks

Link to comment
Share on other sites

Hey Nico,

I am curious why you went back to the old method for loading the js file? The way you have it now referencing an external js file doesn't seem to be causing the issues I was having with your old way of injecting the script code directly, but just wondering why you aren't letting PW handle the js file inclusion?

Also, while I think of it, it is using .live which is deprecated and needs to be replaced by .on

Thanks

Link to comment
Share on other sites

@radek: Thanks!

@adrian: I had to do this because your solution wasn't properly working when the module uses autoload=true (what it needs to use). So the js file would be included at the first position of all js files which means before jquery is included. The result was that you'd never see the actual confirm thing...

Link to comment
Share on other sites

That's weird that you are seeing that. I get the following in this order:

<script type='text/javascript' src='/wire/modules/Jquery/JqueryCore/JqueryCore.js?v=183'></script>
<script type='text/javascript' src='/site/modules/ProcessPageDelete/ProcessPageDelete.js?v=1'></script>

and the confirm alert works fine!

Link to comment
Share on other sites

I get this error on my browser: 

[Error] TypeError: 'undefined' is not a function (evaluating 
'$("li.PageListActiondelete a").live("click", function(el){
        if(!confirm("Are you sure?")) { return false; }
    })')
	(unknown function) (ProcessPageDelete.js, line 2)
	
Link to comment
Share on other sites

Yes, I am using the Zurb Foundation 5 profile which has 1.10.x version of jQuery. Maybe the module could be fixed to use .on?

It isn't always as simple, but in the case of this module with the way that statement is structured, you can simply replace "live" with "on". 

If you want you can file an issue over at: https://github.com/NicoKnoll/ProcessPageDelete/issues/new and ask Nico to make the change. I don't think there is any need to worry about detecting the availability of "on" anymore with a "live" fallback, because PW is using jQuery 1.8 which supports "on".

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 3 months later...

On one installation (using PW dev 2.4.9) I cannot uninstall this module any more. 

 TemplateFile: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'delete-3' for key 'name_parent_id'

Link to comment
Share on other sites

Hey Nico, this thing is mysterious.

With the same setup (PW dev 2.4.9) it makes a difference whether the module was already installed or not:

a) If not already installed, I can install it - and later on de-install it again: no problem.

b) If it was installed - and it normally is here because It is part of my PW startup profile for new projects - then this conflict appears.

My normal workflow is to de-install this module as soon as I am finished with building the site and editors start using it.

That's why I know that this issue wasn't always there.

Do you need more info from me?

Link to comment
Share on other sites

Hi Nico,

that would explain that newly installed versions work, old installs not. :)

I use ModuleManager do keep Modules up-to-date, your module is  the current version. 

Since this is a standard module I use often when setting up things, this is a very old install, with various updates. 

So if you changed something with the install routine in the meantime, this might not be compatible with old installs.

I wonder how to de-install this best - the brute-force way. Trashing the files and removing the entry from the DB table "modules" is probably not enough... 

Link to comment
Share on other sites

ok, de-installation worked with commenting out the uninstall function. I got a message that hooks were removed.

There was no "delete page" subpage in admin/setup/pages/. There was one in admin/pages/ - hope that's the one to delete :-)

Then I re-installed - de-installed and re-installed again. Works! - Can I invite you to a beer?

Link to comment
Share on other sites

There is another issue, but only on one installation. Here the module does not install properly this time....

Notice: Undefined variable: parent in /Users/carl/WWW_TESTSERVER/ullewaeh-git/site/modules/ProcessPageDelete/ProcessPageDelete.module on line 187

As I said the older versions of the module worked flawlessly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...