forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upload => Topic started by: cdawg on May 11, 2015, 07:31:26 am

Title: Batch add/Browser Interface not working for "albums"
Post by: cdawg on May 11, 2015, 07:31:26 am
I've upgraded my gallery to 1.5.36 and come across something. 

When I batch add files and it starts from the "albums" folder, it doesn't seem to work properly and ends in a white page. 

Looking at the URL for the batch, it seems as if the "albums" portion of the URL is gone. 

The URL from the "Ok" Button when the base upload folder is called "Pics"

http://marsha-thomason.com/photos/searchnew.php?startdir=Pics/Television/SafeHouse/101

but when the base upload folder is "albums" that albums folder is missing from the URL

http://marsha-thomason.com/photos/searchnew.php?startdir=Season%20One

when you turn off the browser interface, you can batch from the "albums" folder. 

Any idea on how to get the batch to work properly? 
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Joe Carver on May 12, 2015, 01:47:16 am
What is the setting in Config >> File Settings >> The album directory ?

And, in case the issue might be from something else, and the problem isn't solved by resetting that value:

Please reply with the server settings for:

And enable debug with notices (don't post the output) and take note of the notices only.

Title: Re: Batch add/Browser Interface not working for "albums"
Post by: cdawg on May 12, 2015, 06:29:43 am
Config >> File Settings >> The album directory (I have never changed that setting either)

albums/

 (I have never changed that setting either)

Server Info

Apache Version   2.2.29
PHP Version   5.4.39
MySQL Version   5.5.42-cll
Architecture   x86_64
Operating System   linux


I don't get a notice with de-bug notice, it all works fine till the final screen of batch adding, and then it's a white screen
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: phill104 on May 12, 2015, 11:43:15 am
If possible take a look at the logs for when you get the white screen or enable full error reporting on your server. Depending on these settings, when a server crashes it will either display an error or simply a white screen. Knowing exactly what the error is will greatly help in diagnosis.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: cdawg on May 12, 2015, 03:57:42 pm
I will take a look at the error log this evening.  I will say the batch add/browser interface works on the server like it should if your images are starting from anything but "albums" - the double use of that seems to not be recognized.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: cdawg on May 13, 2015, 07:59:12 am
nothing in the error log. 

The server settings have also remained at the memory_limit is set at 64M and upload_max_size is set at 8M - been that way since the days of 1.3
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Joe Carver on May 14, 2015, 01:26:51 am
With no success in replicating the issue...

Please run versioncheck.php.

What is the folder structure where the files are located?

Is it cpg_root/albums/album_name/some_names.jpg?

Or something else?

If it is as above, try a different theme such as curve: http://marsha-thomason.com/photos/index.php?theme=curve
Your theme or wrapper might be conflicting with javascript that is part of the routine (searchnew.js).

The theme also looks to be in need of updating / editing for use with cpg 1.5x.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: cdawg on May 14, 2015, 04:20:35 am
Joe when you tried to replicate was it batching specifically from an albums folder?

For example I can batch properly when this is the patch

http://marsha-thomason.com/photos/albums/Pics/Television/SafeHouse/102/thumb_S1E2_00115.jpg

but when the path includes albums/albums like this

http://marsha-thomason.com/photos/albums/albums/SeasonOne/001.jpg

it created the white screen when trying to batch using browser interface.  I know of multiple sites across servers, and all have the same problem with batch add browser interface when the patch includes albums/albums

2.  Switched to Curve, same issues. 

3.  Ran version check, no php files effected. 
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Joe Carver on May 18, 2015, 03:14:55 am
I can confirm the effect with different results, all stopping batch uploads.

It will also occur if the sub-folder contains the "albums" folder name.
ex. ...albums/aaalbums, albums/new_albums, etc..

Time is short for me now, so I can only make suggestions.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Αndré on May 29, 2015, 10:10:13 pm
Can anyone please test if this also happens with cpg1.5.34? Maybe I fixed too much in cpg1.5.36.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: allvip on May 30, 2015, 07:11:54 pm
Can anyone please test if this also happens with cpg1.5.34? Maybe I fixed too much in cpg1.5.36.


I have Apahe, PHP, cpg 1.5.34, cpg 1.5.36 on my PC. I have the same settings in Config - File settings for both copermine installations.


http://localhost/cpg15x/albums/albums/SeasonOne/001.jpg
http://localhost/cpg1536/albums/albums/SeasonOne/001.jpg


Not working in 1.5.36. Is working in 1.5.34. In both coppermine installations in the please select a directory box is not showing the path albums/albums/SeasonOne like it does for the Pics folder (albums/Pics/Television/SafeHouse/102/). See attachments. Even if is not showing the path in please select a directory box is working in 1.5.34.

I tryed again and again. The page takes a lot of time to load then error: blank page (http://localhost/cpg1536/searchnew.php?startdir=SeasonOne).

http://localhost/cpg15x/albums/Pics/Television/SafeHouse/102/S1E2_00115.jpg
http://localhost/cpg1536/albums/Pics/Television/SafeHouse/102/S1E2_00115.jpg

http://localhost/cpg15x/albums/test1 (336 files)
http://localhost/cpg15x/albums/test2 (same files + 001.jpg)

http://localhost/cpg1536/albums/test1 (336 files)
http://localhost/cpg1536/albums/test2 (same files + 001.jpg)

Works fine in both coppermine installations.

I dont't know why in other threads users say batch is not working: duplicate. For me it always worked fine. No duplicates issue. Not even when I had allvip.us gallery.


Title: Re: Batch add/Browser Interface not working for "albums"
Post by: allvip on May 30, 2015, 09:00:43 pm
I updated my answer.
Maybe albums/albums is not a good ideea.

http://localhost/cpg15x/albums/SeasonOne/001.jpg works.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Αndré on May 30, 2015, 09:10:18 pm
minibrowser.php itself stops to display sub-directories in the complete path as soon as a directory with the name "album" is opened. E.g. I currently test with a path "cpg/albums/test123/albums/test321" and the minibrowser won't show more than "albums/test123/".

When I try to batch-add from the "test321" directory, the URL in the address bar is "searchnew.php?startdir=test123\test321", so "albums" has been stripped for some reason. I'll investigate further.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Αndré on May 30, 2015, 09:54:01 pm
Maybe albums/albums is not a good ideea.
That doesn't matter. It's a bug I introduced. Please also have a look at Joe's and my replies, Coppermine currently replaces all occurrences of "*albums", regardless where in the path they occur.

However, I think I have a fix for this. Please open minibrowser.php, find
Code: [Select]
echo '<a href="'.$linktarget.'?startdir='.rtrim(str_replace($limitfolder, '',$folder), $folder_sep).'" class="admin_menu" target="_parent">'.cpg_fetch_icon('ok', 2) . $lang_common['ok'].'</a>' . $newline;and replace with
Code: [Select]
        function cpg_str_replace_first($search, $replace, $subject) {
            $pos = strpos($subject, $search);
            if ($pos !== false) {
                return substr_replace($subject, $replace, $pos, strlen($search));
            } else {
                return false;
            }
        }
        echo '<a href="'.$linktarget.'?startdir='.rtrim(cpg_str_replace_first($limitfolder, '', $folder), $folder_sep).'" class="admin_menu" target="_parent">'.cpg_fetch_icon('ok', 2) . $lang_common['ok'].'</a>' . $newline;
(it may also work with a simple substr call, but I noticed that too late :P)

That should fix the batch-add functionality, but not the display of the current path (see my last reply). I'll have a closer look at that issue later.
Title: Re: Re: Batch add/Browser Interface not working for "albums"
Post by: Αndré on May 30, 2015, 10:10:11 pm
it may also work with a simple substr call

This should also work, please confirm:
Code: [Select]
echo '<a href="'.$linktarget.'?startdir='.rtrim(substr($folder, strlen($limitfolder)), $folder_sep).'" class="admin_menu" target="_parent">'.cpg_fetch_icon('ok', 2) . $lang_common['ok'].'</a>' . $newline;
Title: Re: Re: Batch add/Browser Interface not working for "albums"
Post by: allvip on May 30, 2015, 10:13:06 pm
That doesn't matter. It's a bug I introduced. Please also have a look at Joe's and my replies, Coppermine currently replaces all occurrences of "*albums", regardless where in the path they occur.

However, I think I have a fix for this. Please open minibrowser.php, find
Code: [Select]
echo '<a href="'.$linktarget.'?startdir='.rtrim(str_replace($limitfolder, '',$folder), $folder_sep).'" class="admin_menu" target="_parent">'.cpg_fetch_icon('ok', 2) . $lang_common['ok'].'</a>' . $newline;and replace with
Code: [Select]
        function cpg_str_replace_first($search, $replace, $subject) {
            $pos = strpos($subject, $search);
            if ($pos !== false) {
                return substr_replace($subject, $replace, $pos, strlen($search));
            } else {
                return false;
            }
        }
        echo '<a href="'.$linktarget.'?startdir='.rtrim(cpg_str_replace_first($limitfolder, '', $folder), $folder_sep).'" class="admin_menu" target="_parent">'.cpg_fetch_icon('ok', 2) . $lang_common['ok'].'</a>' . $newline;
(it may also work with a simple substr call, but I noticed that too late :P)

That should fix the batch-add functionality, but not the display of the current path (see my last reply). I'll have a closer look at that issue later.

Works even if is not  showing the path in please select a directory box.
Title: Re: Re: Re: Batch add/Browser Interface not working for "albums"
Post by: allvip on May 30, 2015, 10:15:44 pm
This should also work, please confirm:
Code: [Select]
echo '<a href="'.$linktarget.'?startdir='.rtrim(substr($folder, strlen($limitfolder)), $folder_sep).'" class="admin_menu" target="_parent">'.cpg_fetch_icon('ok', 2) . $lang_common['ok'].'</a>' . $newline;

Works even if is still not showing the path in please select a directory box.
Better this solution. Is shorter then the one from reply Reply #13.
Title: Re: Batch add/Browser Interface not working for "albums"
Post by: Αndré on May 30, 2015, 10:50:42 pm
Fix committed in SVN revision 8783.