Module: Rebuild items

sykong

Joined: 2006-04-07
Posts: 21
Posted: Wed, 2013-01-02 00:48
tempg wrote:
sykong wrote:
without having to give my photographers admin access?

Not sure what the relationship is between you and the photographers; not sure of the relationship between the photographers and the website. The request sounds a bit complicated and likely not a good idea for the average user (because then anyone could potentially rebuild images at any time: drains system resources and could also cause issues if more than one person attempted at a time on same photos). Maybe I'm misunderstanding?

Why do the individual photographers need to rebuild the images of albums they don't have permissions on? Perhaps there's another solution that works?

This is a gallery for a church. There are a few regular photographers who will contribute photos. I'm not looking to rebuild any/all photos. Only those where thumbs/resizes that did not get generated properly during upload.

Dave : Yes, there is a resource issue. We are using shared hosting and the thumbs / resizes sometimes fail on large file uploads. Oversized thumbs are obvious to spot just by loading the album page, but oversized resizes take a bit more effort. From time to time, I use the rebuilt module to check for oversized thumbs / resizes and mark them as dirty. It is quite a hassle though to check each folder individually.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-01-02 04:41
Quote:
Yes, there is a resource issue

Perhaps you can get your host to help?

Quote:
sometimes fail on large file uploads

Have you educated your users about adding large images? Perhaps the http://codex.gallery2.org/Gallery3:Modules:max_size might help, but never used so can't tell.

Quote:
It is quite a hassle though to check each folder individually.

So some enhancement to the module would help? How do you see that looking like (UI) and user stroy go? Can you make a html mockup with a user story?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2013-02-03 20:27

@floridave: I recently swapped out the old version of the rebuild items module for the new one.

Issue: "Reset Exif Info" option works as previous, but the "Update tags for all items" results in an error. Hitting "Commit Changes" results in a blank page; a reload of the page spits out an error:

 Kohana_Exception [ kohana/core.errors.403 ]: @todo FORBIDDEN
    MODPATH/gallery/helpers/access.php[ 202 ]
    MODPATH/gallery/helpers/access.php[ 425 ] » access_Core::forbidden()
    MODPATH/rebuild_items/controllers/admin_rebuild_items.php[ 30 ] » access_Core::verify_csrf()
    {PHP internal call} » Admin_Rebuild_items_Controller->handler()
    MODPATH/gallery/controllers/admin.php[ 62 ] » call_user_func_array( arguments )
    {PHP internal call} » Admin_Controller->__call( arguments )
    SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( arguments )
    {PHP internal call} » Kohana_Core::instance( arguments )
    SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )
    APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )
    DOCROOT/index.php[ 102 ] » require( arguments )

Nothing more in the logs; just more of the same:

error: Kohana_Exception [ 403 ]: @todo FORBIDDEN
/modules/gallery/helpers/access.php [ 202 ]
#0 /modules/gallery/helpers/access.php(425): access_Core::forbidden()
#1 /modules/rebuild_items/controllers/admin_rebuild_items.php(30): access_Core::verify_csrf()
#2 [internal function]: Admin_Rebuild_items_Controller->handler()
#3 /modules/gallery/controllers/admin.php(62): call_user_func_array(Array, Array)
#4 [internal function]: Admin_Controller->__call('rebuild_items', Array)
#5 /system/core/Kohana.php(331): ReflectionMethod->invokeArgs(Object(Admin_Controller), Array)
#6 [internal function]: Kohana_Core::instance(NULL)
#7 /system/core/Event.php(208): call_user_func_array(Array, Array)
#8 /application/Bootstrap.php(67): Event_Core::run('system.execute')
#9 /index.php(102): require('/galler...')
#10 {main}

Can't figure out why anything would be forbidden, but only for that task.
Ideas? Maybe the updated version on works with certain versions of Gallery?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-02-03 21:17

This is the image I used for testing the tags:
http://www.langleycom.com/gallery3/var/albums/dog.jpg it has 3 tags in the meta data.
See if it works for you.
What I did was added the item. Then I deleted the tags from the Admin-> content-> tags page. Went back to the item and used the rebuild to get the tags.

If it works for you but not another image... post that image here and I can see if I can reproduce the error.

I'm using the latest Experimental version of G3 from yesterday or the day before & the version 6 from the codex page of the rebuild module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Sun, 2013-02-03 21:52

No go.
Ran into same problem when I tried to rebuild.
I'm not using the latest version of Gallery (because I've been too lazy to update my custom theme for the purpose), but version 6 of the module; maybe that's the issue?

I have to dive into the code a bit more, but it's odd to me that the other rebuild functions work just fine.

Do you have a non-production site with an older version of Gallery? (One of my Galleries is a few versions behind!)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-02-05 21:03

I did find a issue if the album had items with no tags associated with it the module would just crap out. It did not throw a access_Core::verify_csrf() error so not sure why it is not working for you.
With 3.0.5 coming out soon, so I don't have a older version of G3 installed any place. Been doing some testing for 3.0.5.
Please try a experimental version of G3 and see if you experience the same issue. if you do then I can add some debug code I guess to narrow down the issue.

Cheers!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Tue, 2013-02-05 22:20
floridave wrote:
I did find a issue if the album had items with no tags associated with it the module would just crap out.

Thanks for getting back to me. In this case, none of the items in the album had tags, so that may be an important note.
Server space is at a premium for me right now (meaning no non-production site to update to experimental), so I'll first try using batchtag to add a tag to all items, then try to rebuild and update tags. Will report back.

EDIT: Update: Added the tag, but still same error (verify_csrf, as you pointed out). Trying to find a way to narrow down the issue, but at a loss as to how to do that in this case. Since 3.0.5 is near, I'll likely end up just waiting on updating Gallery core and seeing if the issue is resolved in some other way.

 
deanshavit

Joined: 2012-09-28
Posts: 23
Posted: Sat, 2013-04-20 17:46

Floridave,

I am also going to please for the ability to operate on subfolders - I have a situation where I need to rebuild tags on a few thousand items in nested subfolders....re-importing won't work because someone has spent a LOT of time creating custom names for the albums, which would be lost if the items were delted and reimported....going folder by folder rebuilding tags would take weeks.