New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.4.8: Single Image edit mode bug that returns to batch edit after apply. #933

Closed
MarkRH opened this Issue May 21, 2015 · 21 comments

Comments

Projects
None yet
3 participants
@MarkRH

MarkRH commented May 21, 2015

This happened with 1.4.7 and still does. Reference to this thread: http://www.zenphoto.org/support/topic.php?id=1409016

Go to single image edit, change something in the description (or anything) and it goes into batch edit mode and no longer on the same image after hitting apply.

Whether or not it returns to the single image edit or the bulk image edit depends on the sort order of the bulk image edit vs the sort order of the album itself. If I edit a single image that happens to be in the top X of the bulk image edit sort, then it returns to the single image editor. Seems to be related to that bug with the single image edit before that I put on here.

I just hadn't caught it before because normally I am editing the most recent images which matches the sort in both places. I was editing an older image that I noticed it.

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 21, 2015

Member

Hm, we actually thought we had fixed that recently … At the moment I cannot reproduce the issue or I am not using the same settings. The order on the backend is just the backend display order and independent from the actual image order set via the album or gallery options.

Member

acrylian commented May 21, 2015

Hm, we actually thought we had fixed that recently … At the moment I cannot reproduce the issue or I am not using the same settings. The order on the backend is just the backend display order and independent from the actual image order set via the album or gallery options.

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

Ok, album is sorted by Date, Descending. Batch edit on this one album was set to Title, with 10 images per page. I edited the 6th image, changed something, hit apply and it went to batch edit mode. I then changed the batch edit sort to also be Date Descending, re-edited that single image, hit apply and it stayed on the single image.

I then decided to edit the 11th image in single edit mode. Changed something, hit apply, and then it went into batch edit mode with the 1st image of the album at the top.

MarkRH commented May 21, 2015

Ok, album is sorted by Date, Descending. Batch edit on this one album was set to Title, with 10 images per page. I edited the 6th image, changed something, hit apply and it went to batch edit mode. I then changed the batch edit sort to also be Date Descending, re-edited that single image, hit apply and it stayed on the single image.

I then decided to edit the 11th image in single edit mode. Changed something, hit apply, and then it went into batch edit mode with the 1st image of the album at the top.

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

Ahhh crap... nevermind. I need to pay better attention to which local gallery I am working with. Sigh. It works fine. Feel like dumbass now.

MarkRH commented May 21, 2015

Ahhh crap... nevermind. I need to pay better attention to which local gallery I am working with. Sigh. It works fine. Feel like dumbass now.

@MarkRH MarkRH closed this May 21, 2015

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

Ok, I need to keep testing. It did just do it in the 1.4.8 version.

MarkRH commented May 21, 2015

Ok, I need to keep testing. It did just do it in the 1.4.8 version.

@MarkRH MarkRH reopened this May 21, 2015

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

Ok, what I described above is indeed happening to me in version 1.4.8 [3e3fac4] code. I was just testing using my other local gallery that was still 1.4.7. The 1.4.8 one is indeed doing the same thing.

MarkRH commented May 21, 2015

Ok, what I described above is indeed happening to me in version 1.4.8 [3e3fac4] code. I was just testing using my other local gallery that was still 1.4.7. The 1.4.8 one is indeed doing the same thing.

@fretzl

This comment has been minimized.

Show comment
Hide comment
@fretzl

fretzl May 21, 2015

Member

I was able to reproduce it once. Whatever I tried afterwards worked as it should. Weird !

Member

fretzl commented May 21, 2015

I was able to reproduce it once. Whatever I tried afterwards worked as it should. Weird !

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

OK, I edited admin-edit.php around line 844:

                    $singleimage = NULL;
                    if (isset($_GET['singleimage'])) {
                        $simage = sanitize($_GET['singleimage']);
                    echo '<pre>';
                    print_r($images);
                    echo '</pre>';
                        if (array_search($simage, $images) !== false) {
                            $allimagecount = 1;
                            $singleimage = $simage;
                            $images = array($simage);
                        }
                    }

When I first edited the image, the output was:

Array
(
[0] => BassProShop_00000.jpg
[1] => BassProShop_00001.jpg
[2] => BassProShop_00002.jpg
[3] => BassProShop_00003.jpg
[4] => BassProShop_00004.jpg
[5] => BassProShop_00005.jpg
[6] => BassProShop_00006.jpg
[7] => BassProShop_00008.jpg
[8] => BassProShop_00009.jpg
[9] => BassProShop_00010.jpg
[10] => BassProShop_00011.jpg
[11] => BassProShop_00012.jpg
[12] => BassProShop_00013.jpg
[13] => BassProShop_00014.jpg
[14] => BassProShop_00015.jpg
[15] => BassProShop_00016.jpg
[16] => BassProShop_00017.jpg
[17] => BassProShop_00018.jpg
[18] => BassProShop-00007.flv
)

After I hit apply, this was the output:
Array
(
[0] => BassProShop_00000.jpg
[1] => BassProShop_00001.jpg
[2] => BassProShop_00002.jpg
[3] => BassProShop_00003.jpg
[4] => BassProShop_00004.jpg
)

Which did not contain the image I was editing, so it went into batch mode.

MarkRH commented May 21, 2015

OK, I edited admin-edit.php around line 844:

                    $singleimage = NULL;
                    if (isset($_GET['singleimage'])) {
                        $simage = sanitize($_GET['singleimage']);
                    echo '<pre>';
                    print_r($images);
                    echo '</pre>';
                        if (array_search($simage, $images) !== false) {
                            $allimagecount = 1;
                            $singleimage = $simage;
                            $images = array($simage);
                        }
                    }

When I first edited the image, the output was:

Array
(
[0] => BassProShop_00000.jpg
[1] => BassProShop_00001.jpg
[2] => BassProShop_00002.jpg
[3] => BassProShop_00003.jpg
[4] => BassProShop_00004.jpg
[5] => BassProShop_00005.jpg
[6] => BassProShop_00006.jpg
[7] => BassProShop_00008.jpg
[8] => BassProShop_00009.jpg
[9] => BassProShop_00010.jpg
[10] => BassProShop_00011.jpg
[11] => BassProShop_00012.jpg
[12] => BassProShop_00013.jpg
[13] => BassProShop_00014.jpg
[14] => BassProShop_00015.jpg
[15] => BassProShop_00016.jpg
[16] => BassProShop_00017.jpg
[17] => BassProShop_00018.jpg
[18] => BassProShop-00007.flv
)

After I hit apply, this was the output:
Array
(
[0] => BassProShop_00000.jpg
[1] => BassProShop_00001.jpg
[2] => BassProShop_00002.jpg
[3] => BassProShop_00003.jpg
[4] => BassProShop_00004.jpg
)

Which did not contain the image I was editing, so it went into batch mode.

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

Here's my cheesy workaround for now where I just force the image into the array:

            } else if ($subtab == 'imageinfo') {
               $singleimage = NULL;
               if (isset($_GET['singleimage'])) {
                  $simage = sanitize($_GET['singleimage']);
                    echo '<pre>';
                    print_r($images);
                    echo '</pre>';
                  if (array_search($simage, $images) !== false) {
                     $allimagecount = 1;
                     $singleimage = $simage;
                     $images = array($simage);
                  } else {
                     $images[0] = $simage; 
                     $singleimage = $simage;
                     $images = array($simage);
                  }
               }

MarkRH commented May 21, 2015

Here's my cheesy workaround for now where I just force the image into the array:

            } else if ($subtab == 'imageinfo') {
               $singleimage = NULL;
               if (isset($_GET['singleimage'])) {
                  $simage = sanitize($_GET['singleimage']);
                    echo '<pre>';
                    print_r($images);
                    echo '</pre>';
                  if (array_search($simage, $images) !== false) {
                     $allimagecount = 1;
                     $singleimage = $simage;
                     $images = array($simage);
                  } else {
                     $images[0] = $simage; 
                     $singleimage = $simage;
                     $images = array($simage);
                  }
               }
@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 21, 2015

Member

Ok, thanks so far. Will try to reproduce and look into the code.

Member

acrylian commented May 21, 2015

Ok, thanks so far. Will try to reproduce and look into the code.

@acrylian acrylian added the bug label May 21, 2015

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 21, 2015

Member

I have tried your scenario above but I sadly was somehow not able to reproduce it so far … Neither goes anything from the single edit to the batch edit page nor does the "back" button arrive on the wrong page…

Member

acrylian commented May 21, 2015

I have tried your scenario above but I sadly was somehow not able to reproduce it so far … Neither goes anything from the single edit to the batch edit page nor does the "back" button arrive on the wrong page…

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 21, 2015

I can reproduce it at will with any album I have, even with the latest master. It never doesn't do it to me.

I have an album with more than 5 images in it. I have the batch edit mode set to 5 images per page and sorted by Filemtime (descending) for example. I then have the Album sorted the same way, Filemtime (descending). I then view the 6th image:

singleimage = twitter-background-Michelle_OKC.jpg

Array
(
    [0] => colonists-encounter-suit-blue.jpg
    [1] => black-artisans-outfit.jpg
    [2] => emerald-artisans-outfit.jpg
    [3] => default-outfit.jpg
    [4] => Luperza_and_Firiona_Vie_2014.jpg
    [5] => twitter-background-Michelle_OKC.jpg
    [6] => SoELive-PurrfectStorm.jpg
    [7] => macarena.jpg
    [8] => hard-red.jpg
    [9] => injeopardy.jpg
    [10] => 100_0033.JPG
    [11] => 100_0032.JPG
    [12] => 100_0031.JPG
    [13] => 100_0015.JPG
    [14] => 100_0014.JPG
)

Change something and hit Apply:

singleimage = twitter-background-Michelle_OKC.jpg

Array
(
    [0] => colonists-encounter-suit-blue.jpg
    [1] => black-artisans-outfit.jpg
    [2] => emerald-artisans-outfit.jpg
    [3] => default-outfit.jpg
    [4] => Luperza_and_Firiona_Vie_2014.jpg
)

Unless I force the image into the array it opens in batch edit mode at the 1st image of the album.

MarkRH commented May 21, 2015

I can reproduce it at will with any album I have, even with the latest master. It never doesn't do it to me.

I have an album with more than 5 images in it. I have the batch edit mode set to 5 images per page and sorted by Filemtime (descending) for example. I then have the Album sorted the same way, Filemtime (descending). I then view the 6th image:

singleimage = twitter-background-Michelle_OKC.jpg

Array
(
    [0] => colonists-encounter-suit-blue.jpg
    [1] => black-artisans-outfit.jpg
    [2] => emerald-artisans-outfit.jpg
    [3] => default-outfit.jpg
    [4] => Luperza_and_Firiona_Vie_2014.jpg
    [5] => twitter-background-Michelle_OKC.jpg
    [6] => SoELive-PurrfectStorm.jpg
    [7] => macarena.jpg
    [8] => hard-red.jpg
    [9] => injeopardy.jpg
    [10] => 100_0033.JPG
    [11] => 100_0032.JPG
    [12] => 100_0031.JPG
    [13] => 100_0015.JPG
    [14] => 100_0014.JPG
)

Change something and hit Apply:

singleimage = twitter-background-Michelle_OKC.jpg

Array
(
    [0] => colonists-encounter-suit-blue.jpg
    [1] => black-artisans-outfit.jpg
    [2] => emerald-artisans-outfit.jpg
    [3] => default-outfit.jpg
    [4] => Luperza_and_Firiona_Vie_2014.jpg
)

Unless I force the image into the array it opens in batch edit mode at the 1st image of the album.

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 22, 2015

Member

I do believe you that you encounter the issue. I will try again and let you know.

Member

acrylian commented May 22, 2015

I do believe you that you encounter the issue. I will try again and let you know.

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 22, 2015

I went ahead and upgraded the code on my other gallery so that both local development ones are running 1.4.8 and it has the same issue. Thanks for looking at it again.

MarkRH commented May 22, 2015

I went ahead and upgraded the code on my other gallery so that both local development ones are running 1.4.8 and it has the same issue. Thanks for looking at it again.

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 22, 2015

Member

I sadly still cannot reproduce the issue … Do I miss any details maybe somewhere? No matter if I set the album sorting or the display sorting the same or different the image is in the array on the single edit page. Same if I change them around. I tried with changing images per page (my test album has even 500+ image) nothing unwanted happens.

I am still never taken wrongfully to the batch edit from the single edit page. I display the array and the image I am editing is always in there, too, on the right position within its batch edit page …

Member

acrylian commented May 22, 2015

I sadly still cannot reproduce the issue … Do I miss any details maybe somewhere? No matter if I set the album sorting or the display sorting the same or different the image is in the array on the single edit page. Same if I change them around. I tried with changing images per page (my test album has even 500+ image) nothing unwanted happens.

I am still never taken wrongfully to the batch edit from the single edit page. I display the array and the image I am editing is always in there, too, on the right position within its batch edit page …

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 22, 2015

Sigh.. are we even running the same code? I can't get it to not happen and you can't get it to happen.

The default batch edit is 10 images per page. I have 15 images per page in the gallery. If I pick an image on say the 2nd page to view then edit the image (single image edit), hit apply, then it goes into batch edit at the 1st image of the batch edit sort and not to my image. Happens with all albums in both my galleries. I guess I'll just keep my work around in the code and leave it at that. If you can't reproduce it, you can't figure out what's going on. I'll go ahead and update my production galleries anyway. Maybe I'll try some different themes and see what happens. I dunno. Hmm I could make a video of what is happening.

MarkRH commented May 22, 2015

Sigh.. are we even running the same code? I can't get it to not happen and you can't get it to happen.

The default batch edit is 10 images per page. I have 15 images per page in the gallery. If I pick an image on say the 2nd page to view then edit the image (single image edit), hit apply, then it goes into batch edit at the 1st image of the batch edit sort and not to my image. Happens with all albums in both my galleries. I guess I'll just keep my work around in the code and leave it at that. If you can't reproduce it, you can't figure out what's going on. I'll go ahead and update my production galleries anyway. Maybe I'll try some different themes and see what happens. I dunno. Hmm I could make a video of what is happening.

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 22, 2015

Member

The default batch edit is 10 images per page. I have 15 images per page in the gallery.

The theme value uses a different option than the batch edit display and should not be related

@fretzl also tried again and it didn't happen again for him, too. I tried a lot back and forth. Really strange. The only way to make that happen is to rename the filename of an image. But then it makes sort of sense.

Make that video, maybe we are missing a detail or something.

Member

acrylian commented May 22, 2015

The default batch edit is 10 images per page. I have 15 images per page in the gallery.

The theme value uses a different option than the batch edit display and should not be related

@fretzl also tried again and it didn't happen again for him, too. I tried a lot back and forth. Really strange. The only way to make that happen is to rename the filename of an image. But then it makes sort of sense.

Make that video, maybe we are missing a detail or something.

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 22, 2015

Here's a quick video I made. No audio though. https://www.youtube.com/watch?v=PBX-KcDrOIU

If it needs audio explanation let me know. Try to figure out this recording software to only grab what I want.

MarkRH commented May 22, 2015

Here's a quick video I made. No audio though. https://www.youtube.com/watch?v=PBX-KcDrOIU

If it needs audio explanation let me know. Try to figure out this recording software to only grab what I want.

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 23, 2015

Member

Thanks, it gives at least the missing detail that you come from the frontend. I did try from the backend only!

Member

acrylian commented May 23, 2015

Thanks, it gives at least the missing detail that you come from the frontend. I did try from the backend only!

@fretzl

This comment has been minimized.

Show comment
Hide comment
@fretzl

fretzl May 23, 2015

Member

Yep. I can reproduce it coming from the frontend.

Member

fretzl commented May 23, 2015

Yep. I can reproduce it coming from the frontend.

@MarkRH

This comment has been minimized.

Show comment
Hide comment
@MarkRH

MarkRH May 23, 2015

Oh, you guys were clicking on the edit all image data link from within the bulk image edit. LOL, I've never used that. I didn't even realize that was there. I was asking myself "what's the backend way?". Glad fretzl was able to reproduce it. Wish I had described it more clearly initially. Glad the video helped.

MarkRH commented May 23, 2015

Oh, you guys were clicking on the edit all image data link from within the bulk image edit. LOL, I've never used that. I didn't even realize that was there. I was asking myself "what's the backend way?". Glad fretzl was able to reproduce it. Wish I had described it more clearly initially. Glad the video helped.

@acrylian

This comment has been minimized.

Show comment
Hide comment
@acrylian

acrylian May 23, 2015

Member

That's why every tiny detail is important ;-) Now I can reproduce it as well and it makes sense since without the backend batch edit page it indeed uses the frontend order internally.

Member

acrylian commented May 23, 2015

That's why every tiny detail is important ;-) Now I can reproduce it as well and it makes sense since without the backend batch edit page it indeed uses the frontend order internally.

@trisweb trisweb closed this in 74a13f7 May 26, 2015

acrylian added a commit that referenced this issue May 27, 2015

Some follow up for #933: The back button now leads to the right backe…
…nd bulk edit subpage and jumps to the image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment