[SOLVED] Can't move album
pkellum
Joined: 2005-04-13
Posts: 6 |
Posted: Sun, 2005-04-17 19:27 |
I get the following error message when trying to move an album to another sub-album. Warning: rename(E:\gallery\albums\useralbums\pkellum\Patrick-Jr-200504\,E:\gallery\albums\useralbums\pkellum\patrickjr\/Patrick-Jr-200504): No such file or directory in c:\www\html\modules\gallery2\modules\core\classes\GalleryPlatform.class on line 455 ---- |
|
Posts: 32509
i guess you have found there a bug.
GalleryFileSystemEntity::move
current code
by definition, fetchPath() returns a path that is delimited by a platform specific slash, so the additional '/' in the $newPath = $newParentPath . '/' . $newPathComponent should not be there.
now, the question is, why this wasn't detected / covered by unit tests.
Posts: 32509
pkellum, could you browse to yourgalleryurl/lib/tools/phpunit/index.php?filter=itemmove
(note the itemmove filter in the url)
are all these tests green? this is really important to us to guarantee functionality on windows platforms.
thanks.
and if it is not green, please edit the file
modules/core/classes/GalleryFileSystemEntity.class
about line 261:
change:
$newPath = $newParentPath . '/' . $newPathComponent;
to:
$newPath = $newParentPath . $newPathComponent;
now check the the unit tests again with the itemmove filter.
are all green now?
thanks.
Posts: 6
I tested it and all was green, I changed the code and tested again, still green. But, it now moves the directory properly
Thanks!
Posts: 32509
pkellum, thanks.
I'm fixing it in the source.
The strange thing is, if you use "move test\foo test\/foo" in the windows command line, it ignored the extra slash.
probably php handles it a little differently.
now, all we need is a unit test to expose the problem.
Posts: 32509
fixed in cvs and a new unit test should expose the problem if someone reintroduces such a typo in this method.