adding new album or editing old one breaks paths

BillWill

Joined: 2008-08-28
Posts: 205
Posted: Mon, 2012-06-04 02:12

After about a month, I added a new album to my site, the same way I always create albums. Once I click the save button, I get the message: "The album 'New Album - June 1, 2012' is not writable."

However, this is not true. What is happening is:

1. No directories are created.
2. The URL to the new album instead of the expected album/2012/newalbum is:
album/2012/oldalbum/img_5312/newalbum

I checked out the record created, and both the "relative_path_cache" and "relative_url_cache" fields have the oldalbum/img_5312 between the the 2012 and the newalbum.

Another clue is when I edited the title of an existing album, although the URL remained, the album cover is no longer displayed, and the message "The album 'Existing Album' is not writable."

Where is the coming from? I haven't changed any settings in the album admin area, nor have I changed the htaccess file. I even removed the .htaccess files from my root and from the album (I used it to remove index.php from the path a long time ago.) Removing then has no effect on this issue.

I am baffled.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Mon, 2012-06-04 02:27

I saw a suggestion from October 2011 to run Fix your Gallery for this,
http://gallery.menalto.com/node/103880

but I also saw another post from October that running it broke even more links:
http://gallery.menalto.com/node/104022

Not sure if either of these apply to my situation, or if the Fix your Gallery is still applicable for the current version of Gallery.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2012-06-04 02:42
Quote:
is not writable.

You need to verify that the /var/* directory and all files inside are writable by the web-server.
the var directory and any directories and files below it need to be writable by the webserver. Check the permissions on the specific directory gallery is complaining about not being able to write to. Your albums are located under var/albums.
- chmod-R 777 var/ should to the trick. If not your host is the best people to get that done.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Mon, 2012-06-04 12:03

Hi Dave -

My albums have always worked in the past with 755 permissions, and I had not changed that.

However, with nothing else to try, I made all my directories 777 and it didn't do anything.

The reason I didn't think this was a problem is that I think since the paths are all wrong, what is causing the error message to say the directory is not writeable is because the directory album/existingalbum/img_3455.jpg/newalbum doesn't exist. In fact it *can't* exist, as an image can't be a subdirectory.

Any other ideas?

update:

It is only the 2012 album that is having this issue. The other years are fine, which makes me think it has something to do with the changes I made here: http://gallery.menalto.com/node/105838 although I haven't done anything since the time they were still working.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2012-06-04 14:45
BillWill wrote:
The other years are fine, which makes me think it has something to do with the changes I made here: http://gallery.menalto.com/node/105838

There's a lot in that thread, some with htaccess, some just with modules. The point, I have no idea what you may or may not have ended up changing.

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Mon, 2012-06-04 15:09

Sorry. Sometimes I mistake tmi for being thorough. This is the part of the thread that pertains to what I did.

1. set up an album for each year, "2012, 2011, etc", to place your albums and sub albums for that year into. You could then use a module like item_links so that anyone who clicks into the root album will be automatically redirected to a specific years album (so navigating to http://gallery.example.com/index.php would load http://gallery.example.com/index.php/2012 instead).

2. You could then use custom_menus to provide links to the older years albums. This would effectively hide the main album so visitors wouldn't see the year albums and would not require you to move albums around when a year ends so you wouldn't break the links from the previous years albums.

Then here is the part in the .htaccess file:

#removes index.php from URL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /album
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
RewriteRule ^index.php/(.*) $1 [QSA,R,L]
</IfModule>

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Mon, 2012-06-04 16:14

Well, a lot of people were coming to the site to see the photos from this weekend, so I closed my eyes and ran "Fix Your Album"

That fixed things in all but one album. Worse case scenario, I'll delete this one remaining album and start over.

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick

 
BillWill

Joined: 2008-08-28
Posts: 205
Posted: Tue, 2012-06-05 14:20

Well, so far I think everything is back to normal. As I suspected, write permissions were not the issue, but one of paths.

The last album, refused to cooperate. I tried moving it around with the organize module, thinking that would set the paths, but nothing really happened to change or fix things. I think the path issue was above the level of Organize. It would move where the album was displayed, but all the thumbs, resizes, etc. did not display. Finally just deleted it and recreated it.

Where do these get fixed? I ask this for future reference, as my issues have all been solved (as far as I can tell.)

===========================
Gallery 3.0.2
PHP - 5.3.8 cgi-fcgi
Apache/2.2.21 (Unix)
mysqli 5.0.92
Clean Canvas theme

Toolkits = Exif, Gd, ImageMagick