Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird problems with GS3.2.0 and News Manager plugin
#1
My site was working very fine (GS3.2.0 + NM updated version), but weirdly, when I delete a post, it shows this message:

Warning: rename(D:\Inetpub\webs\my_site/data/posts/prova.xml,D:\Inetpub\webs\my_site/backups/posts/prova.xml) [function.rename]: File exists in D:\Inetpub\webs\my_site\plugins\news_manager\inc\functions.php on line 147

Any help please???
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#2
Oh, I thought we had this rename/Windows issue fixed...

1. Even with that error, has the post been deleted?
2. Do you have debug mode enabled?
3. PHP version?
4. Did this work ok with GS 3.1.2 + NM 2.3.2? (can you check with a test install?)
Reply
#3
I can prepare a quick patch for you that may fix this, but I'd like to know if this issue also happens with GS 3.1.2 in the same Windows server you're using for GS 3.2.0, if possible.
Reply
#4
This a nm or gs bug Carlos?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
It seems it's an issue that only happens in some Windows systems, with PHP's rename when used to move a file AND the destination exists.

GS only uses rename in ZipArchive.php, I don't know if there could be some issue there.

I thought this was fixed by https://github.com/cnb/News_Manager-gets...394ec41ded

I cannot reproduce this issue, so I'll wait for D.O.'s response.
If it happens with GS 3.2.0 but not with 3.1.2, another test I wanted him to do is enabling GSSUPPRESSERRORS in gsconfig.
Reply
#6
Thanks for your help, mates
@Carlos:

1. Yes, even with that error the post has been deleted
2. No, debug mode wasn't enabled
3. PHP version is 5.2.14
4. it was okay with the old GS version
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#7
Ok!

Now please try this - uncomment (or add) this in your GS 3.2.0 site's gsconfig, like this:

Code:
# Forces suppression of php errors when GSDEBUG is false, despite php ini settings
define('SUPPRESSERRORS',true);

then try again deleting some post.

(Next test will be a patch for NM)
Reply
#8
Is this an ajax action Carlos.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
No, no.
To have the undo functionality, News Manager moves deleted posts to its backups folders using PHP's rename function, that seems to throw errors in some Windows/PHP environments (not mine).
Reply
#10
Hi carlos,
no way.. it shows again that message.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#11
Well it's a warning, so php errors must be enabled, it's not fatal errors.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
it's not a fatal error but it disturbs who has to add news on my site...
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#13
No but why is error reporting on in the first place.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#14
@shawn_a

I don't understand is why D.O. didn't have this error in GS 3.1.2 but does in 3.2.0 with GSSUPPRESSERRORS enabled (wasn't this setting supposed to make it work like pre-3.2?)

This is the function where the error happens:
Code:
function nm_rename_file($oldfile,$newfile) {
  if (!rename($oldfile,$newfile)) {
   if (copy ($oldfile,$newfile)) {
       unlink($oldfile);
       return TRUE;
    }
    return FALSE;
  }
  return TRUE;
}

It's in the first if. I added that function precissely because some Windows systems couldn't move the file using rename if the destination existed.

I can think of two ways to fix D.O.'s problem,

replacing the if line by:
Code:
if (!@rename($oldfile,$newfile)) {

or by:
Code:
if ((strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') or !rename($oldfile,$newfile)) {

What do you suggest?
I prefer not to use the @ operator (in fact, I'd like to remove many of those that are in the plugin), but the second one looks a bit ugly to me. :-)

Or do you think I should leave it like it is, and it's D.O. (or any other Windows user having this issue) who should fix the server configuration?
Reply
#15
No clue, sounds like it works, but throws an error. So turn error reporting off, I mean is it a production site? Why are errors even on.

Suppress errors should fix it, but maybe his ini is not overridable, there is no way of knowing, or maybe he did it wrong.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#16
@shawn_a Thanks.

@D.O. So you can:

- as shawn_a suggests, check your server configuration and turn error reporting off if possible.
or:
- try one of the patches I suggested above, e.g.
edit news_manager/inc/functions.php, find function nm_rename_file(...) and change the first if to:
Code:
if (!@rename($oldfile,$newfile)) {
Reply
#17
THANKS Carlos, it's perfect!!!!
The patch "if (!@rename($oldfile,$newfile)) {" worked great!

But - at the same time - another old problem came out...

I typed a post with this letters "L'è" and when I tried to delete it GS allerted me with this message: "Error: incorrect path". After it, it was impossible to delete the post.

Into the folder named "posts" the file was written in this way: "l%E3%A8.xml". Then I tried to use your alternative "basic.php" for Latin language, but it didn't work. I hope it can be useful to fix these bugs.

Thanks again!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#18
Thanks for reporting.

The issue (that should happen not only with NM posts but also with GS normal pages) will be fixed in GS 3.2.1. (You could test the beta, BTW)

At the meantime, for GS 3.2.0 you could use the RomanTranslit plugin.
Reply
#19
Yes true it does NOT depend on NM Updated. I hope they will fix this bug in the next version of GS.
By the way, I tried this "RomanTranslit" plugin and it works with a title like "L'è"...
Thanks again for your help =D
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply




Users browsing this thread: 3 Guest(s)