Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Batch add/Browser Interface not working for "albums"  (Read 21016 times)

0 Members and 1 Guest are viewing this topic.

cdawg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Batch add/Browser Interface not working for "albums"
« 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? 
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Batch add/Browser Interface not working for "albums"
« Reply #1 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:
  • Server type / OS / Version
  • PHP version

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

cdawg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Batch add/Browser Interface not working for "albums"
« Reply #2 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
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Batch add/Browser Interface not working for "albums"
« Reply #3 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.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

cdawg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Batch add/Browser Interface not working for "albums"
« Reply #4 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.
Logged

cdawg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Batch add/Browser Interface not working for "albums"
« Reply #5 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
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Batch add/Browser Interface not working for "albums"
« Reply #6 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.
« Last Edit: May 14, 2015, 01:33:50 am by Joe Carver »
Logged

cdawg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Batch add/Browser Interface not working for "albums"
« Reply #7 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. 
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1545
  • aka 'i-imagine'
    • Home Page
Re: Batch add/Browser Interface not working for "albums"
« Reply #8 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.
  • Use another method, the HTML 5 upload plugin has great reviews, for example.
  • It might be possible to rename the folder and run a query to replace the value in the db Pictures table
  • [It might be possible to modify the code, but as with the suggestion above, I can't  be certain/li]

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add/Browser Interface not working for "albums"
« Reply #9 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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Batch add/Browser Interface not working for "albums"
« Reply #10 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.


« Last Edit: May 30, 2015, 08:59:53 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Batch add/Browser Interface not working for "albums"
« Reply #11 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add/Browser Interface not working for "albums"
« Reply #12 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add/Browser Interface not working for "albums"
« Reply #13 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Re: Batch add/Browser Interface not working for "albums"
« Reply #14 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;
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Batch add/Browser Interface not working for "albums"
« Reply #15 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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Re: Batch add/Browser Interface not working for "albums"
« Reply #16 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Batch add/Browser Interface not working for "albums"
« Reply #17 on: May 30, 2015, 10:50:42 pm »

Fix committed in SVN revision 8783.
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 20 queries.