[wp-testers] sorta an off the wall bug

Philip M. Hofer (Frumph) philip at frumph.net
Thu Jun 21 19:00:59 UTC 2012


Yeah, I got you, and understand.    I was reiterating for Nacin who wanted 
more information.

It is happening to some people, no idea why - or with what version of 
WordPress it was happening with - or even if it was a plugin or theme that 
might have had set it.

Which is why I have no problem referring that as a possibility to why 
wp_upload_dir() fails as a thing to check when debugging those instances.



-----Original Message----- 
From: Otto
Sent: Thursday, June 21, 2012 11:50 AM
To: wp-testers at lists.automattic.com
Subject: Re: [wp-testers] sorta an off the wall bug

On Thu, Jun 21, 2012 at 1:41 PM, Philip M. Hofer (Frumph)
<philip at frumph.net> wrote:
> actually no, but it does return with the old 
> /home/funk/wp-content/uploads/
>
> { ["error"]=> string(142) "Unable to create directory
> /home1/tkdanimc/public_html/nikkisprite/wp-content/uploads/2012/06
>
> string(71)
> "/home/tdoherty/public_html/nikkisprite.com/wp-content/themes/comicpress"
>
> tkdanimc = old site
> tdoherty = new site
>
> the /home1/tkdanimc/public_html/nikkisprite/wp-content/uploads  is what 
> was
> found in the upload_path
>
>
> so somewhere I cannot read where it doesn't strip out the old ABSPATH
> portion properly

No, it doesn't strip out the old ABSPATH portion *at all*, because it
has no way to know what the old ABSPATH portion is. It can't do what
you're thinking it can do.

Look, you're looking at this all wrong and backwards here.

1. The upload_path setting is an option in the database.
2. If you have it set to an absolute path, then yes, it will attempt
to use that absolute path, hell or high-water. This is desired
behavior, because maybe I want my uploads to go somewhere special on
my server.
3. If you have it set to a relative path, then it's assumed to be
relative to the ABSPATH, whatever that is currently.

This is all correct behavior. There's no code errors there.

The question you're asking is the wrong one. What you need to find is
this: "Why was the upload_path set to an absolute path?"

At some point in the past, something happened somewhere that caused
that upload_path to be set to an absolute path. When you moved the
system, that bit you, and yes, it bit you correctly. The setting was
wrong and should not have been absolute.

But, the setting does not *default* to an absolute path, and WordPress
does not try to convert it from an absolute path to a relative one if
you have explicitly changed it to be absolute. When you put in
/foo/bar/whatever on that Settings-Media page, it assumes you know
what you're doing and takes your setting at face value.

-Otto
_______________________________________________
wp-testers mailing list
wp-testers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-testers 



More information about the wp-testers mailing list