Advertisement

1.5.12 joomla.filesystem.file FTP bug?

This forum is for reporting bugs in Joomla!. Please don't report problems with extensions in here.
Locked
drewgg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 161
Joined: Thu Oct 30, 2008 7:27 pm

1.5.12 joomla.filesystem.file FTP bug?

Post by drewgg » Wed Jul 01, 2009 7:24 pm

After updating to 1.5.12 a component (that included image uploading) started erring, saying the file failed to upload. However, the files were successfully being uploaded into the destination directory.

The component is calling JFile::upload() which is located in /libraries/joomla/filesystem/file.php (line 311).

The change made to this function was due to this bug report: http://joomlacode.org/gf/project/joomla ... m_id=16593

The code change was here:

1.5.11 ->

Code: Select all

			// Copy the file to the destination directory
			if ($ftp->store($src, $dest)) {
				$ftp->chmod($dest, 0777);
				$ret = true;
			} else {
				JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
			}
1.5.12 ->

Code: Select all

			// Copy the file to the destination directory
			if (is_uploaded_file($src) && $ftp->store($src, $dest))
			{
                		unlink($src);
			} else {
				JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
			}
The missing $ret = true; results in the JFile::upload() returning false even though the file is successfully uploaded.

Adding the $ret = true; back in solved the issue.

Code: Select all

			// Copy the file to the destination directory
			if (is_uploaded_file($src) && $ftp->store($src, $dest))
			{
                		$ret = true;
                		unlink($src);
			} else {
				JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
			}

Advertisement
user deleted

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by user deleted » Wed Jul 01, 2009 7:31 pm

Hi,

Thanks for raising the issue and including a possible patch. I've notified the Bug Squad about your post so they won't miss it.

vickipayne
Joomla! Apprentice
Joomla! Apprentice
Posts: 49
Joined: Wed Jan 28, 2009 7:27 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by vickipayne » Wed Jul 01, 2009 9:37 pm

Code: Select all

         // Copy the file to the destination directory
         if (is_uploaded_file($src) && $ftp->store($src, $dest))
         {
                      $ret = true;
                      unlink($src);
         } else {
            JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
         }
Thank you for posting this fix, drewgg. It got rid of the upload error for me.

User avatar
airton
Joomla! Ace
Joomla! Ace
Posts: 1368
Joined: Sun Nov 04, 2007 1:12 am
Location: Brazil
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by airton » Wed Jul 01, 2009 9:50 pm

Hello drewgg and vickipayne,

Can you please test the patch at http://joomlacode.org/gf/project/joomla ... m_id=17053 and see if it corrects the issue?

Thanks,
Airton Torres
Joomla Bug Squad http://groups.google.com/group/joomlabugsquad
Community website - http://community.joomla.org
Unsolicited support PMs will be deleted and the user added to the foes list.

vickipayne
Joomla! Apprentice
Joomla! Apprentice
Posts: 49
Joined: Wed Jan 28, 2009 7:27 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by vickipayne » Wed Jul 01, 2009 10:07 pm

Hi, airton. I don't have a patch utility to adequately test your file, but I've "hand-installed" patches before and this one looks correct.

Thanks,
Vicki

drewgg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 161
Joined: Thu Oct 30, 2008 7:27 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by drewgg » Thu Jul 02, 2009 1:24 pm

I am in the same boat as vickipayne about not using a patch utility but the patch looks correct according to my knowledge (looking at the patch structure, line number/length change, and code change).

User avatar
JoomArt
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Thu Jul 02, 2009 7:18 am
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by JoomArt » Sat Jul 04, 2009 1:49 pm

Thanks drewgg....that was helpful
http://www.JoomlArt.ir - RTL Joomla Templates

archinovum
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Aug 30, 2006 4:37 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by archinovum » Sat Jul 04, 2009 11:46 pm

I just wanted to thank you - you really made my day :-)

Quick and Dummy-Friendly solution!!!

Greeets

Michael

User avatar
weting
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 103
Joined: Sun Nov 25, 2007 9:10 am
Location: Aspudden, Stockholm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by weting » Mon Jul 06, 2009 7:34 am

One more thank you for your simple and easy solution.

/I
Det finns en mening med allt som sker...

User avatar
koolie
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Mon Jul 10, 2006 8:57 pm
Location: Wiscosin, USA
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by koolie » Tue Jul 07, 2009 8:14 pm

Thanks a ton. Solved by problem instantly!
Pat
"and it's the ocean flowing in our veins"
http://www.patrickkuhl.com

itaym
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Thu Nov 20, 2008 4:10 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by itaym » Thu Jul 09, 2009 11:49 am

for me it doesnt work.

after i upload i get this error:

JFTP::store: Bad response
Warning: Failed to move file!
Error. Unable to upload file.


any suggestions?

User avatar
mandville
Joomla! Master
Joomla! Master
Posts: 15157
Joined: Mon Mar 20, 2006 1:56 am
Location: The Girly Side of Joomla in Sussex

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by mandville » Thu Jul 09, 2009 12:05 pm

itaym wrote:for me it doesnt work.

after i upload i get this error:

JFTP::store: Bad response
Warning: Failed to move file!
Error. Unable to upload file.


any suggestions?
that is more a permissions issue, search the forums for JFTP::store:
HU2HY- Poor questions = Poor answer
Un requested Help PM's will be reported, added to the foe list and possibly just deleted
portable mini golf https://www.puttersminigolf.co.uk/

itaym
Joomla! Apprentice
Joomla! Apprentice
Posts: 48
Joined: Thu Nov 20, 2008 4:10 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by itaym » Thu Jul 09, 2009 12:57 pm

yes.
in other site it's working.
i believe its another issue.
i will check.

Thnak you!!

User avatar
sparkosis
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Mar 06, 2007 6:03 pm
Location: Loveland, Colorado, USA
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by sparkosis » Fri Jul 10, 2009 12:33 am

This suggested solution worked for me. I was having trouble uploading images in the backend with JCE, and image uploads in front and backend with JoomGallery. I thought it was a JoomGallery issue until I found the JCE issue.

Changing /libraries/joomla/filesystem/file.php as recommended fixed everything.

Thank you, thank you, thank you!!!
Richard
Richard Sparks, Website Developer
Sparks Arts - http://www.sparksarts.com
[email protected]

User avatar
CDTOAadmin41
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Wed Sep 10, 2008 8:54 pm
Location: Upland, CA
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by CDTOAadmin41 » Mon Jul 13, 2009 10:42 pm

drewgg wrote:After updating to 1.5.12 a component (that included image uploading) started erring, saying the file failed to upload. However, the files were successfully being uploaded into the destination directory.

The component is calling JFile::upload() which is located in /libraries/joomla/filesystem/file.php (line 311).

The change made to this function was due to this bug report: http://joomlacode.org/gf/project/joomla ... m_id=16593

The code change was here:

1.5.11 ->

Code: Select all

			// Copy the file to the destination directory
			if ($ftp->store($src, $dest)) {
				$ftp->chmod($dest, 0777);
				$ret = true;
			} else {
				JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
			}
1.5.12 ->

Code: Select all

			// Copy the file to the destination directory
			if (is_uploaded_file($src) && $ftp->store($src, $dest))
			{
                		unlink($src);
			} else {
				JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
			}
The missing $ret = true; results in the JFile::upload() returning false even though the file is successfully uploaded.

Adding the $ret = true; back in solved the issue.

Code: Select all

			// Copy the file to the destination directory
			if (is_uploaded_file($src) && $ftp->store($src, $dest))
			{
                		$ret = true;
                		unlink($src);
			} else {
				JError::raiseWarning(21, JText::_('WARNFS_ERR02'));
			}
my update patch had the code all ready, my issue is that when I upload an image in the Media Manager, the image uploads "completed", but you can not see the image thumb.

my Linux administrator was let go, so i am guessing my work, :(
He who post the most, know the most answer's

Helaman
Joomla! Explorer
Joomla! Explorer
Posts: 302
Joined: Fri Oct 13, 2006 8:26 pm
Location: Shingle Springs, CA USA
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by Helaman » Sat Jul 18, 2009 2:35 am

thanks fixed my problem with the uploading error! :p :p :p

User avatar
mandville
Joomla! Master
Joomla! Master
Posts: 15157
Joined: Mon Mar 20, 2006 1:56 am
Location: The Girly Side of Joomla in Sussex

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by mandville » Sat Jul 18, 2009 6:57 am

CDTOAadmin41 wrote: my update patch had the code all ready, my issue is that when I upload an image in the Media Manager, the image uploads "completed", but you can not see the image thumb.

my Linux administrator was let go, so i am guessing my work, :(
sounds stupid, but you do have media manager on the thumbnail view and not the detail view
HU2HY- Poor questions = Poor answer
Un requested Help PM's will be reported, added to the foe list and possibly just deleted
portable mini golf https://www.puttersminigolf.co.uk/

User avatar
CDTOAadmin41
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Wed Sep 10, 2008 8:54 pm
Location: Upland, CA
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by CDTOAadmin41 » Mon Jul 20, 2009 2:59 pm

mandville wrote:
CDTOAadmin41 wrote: my update patch had the code all ready, my issue is that when I upload an image in the Media Manager, the image uploads "completed", but you can not see the image thumb.

my Linux administrator was let go, so i am guessing my work, :(
sounds stupid, but you do have media manager on the thumbnail view and not the detail view
so I guess I figured the issue this weekend.
some folders where locked after the install of 1.5.12, so I gave my self different permissions. also the FTP configurations where changed to some default mode. here at work we host our own servers, so we have more options then the norm. the file folder was set to 775
He who post the most, know the most answer's

User avatar
dyrer
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 176
Joined: Wed Aug 24, 2005 10:33 am
Location: Greece
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by dyrer » Tue Jul 21, 2009 3:56 pm

Thanks works for me. Am waiting for joomla 1.5.13

User avatar
airton
Joomla! Ace
Joomla! Ace
Posts: 1368
Joined: Sun Nov 04, 2007 1:12 am
Location: Brazil
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by airton » Thu Jul 23, 2009 6:19 am

Hi all,

J1.5.13 has just been released with this and other fixes. See my signature. :)

Regards,
Airton Torres
Joomla Bug Squad http://groups.google.com/group/joomlabugsquad
Community website - http://community.joomla.org
Unsolicited support PMs will be deleted and the user added to the foes list.

marrydavidson
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Apr 14, 2010 6:57 am

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by marrydavidson » Wed Apr 14, 2010 10:06 am

thanks for sharing this

Varsys
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Thu Sep 18, 2008 3:31 pm
Location: Chicago, IL
Contact:

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by Varsys » Wed Sep 08, 2010 10:07 pm

It worked! Thanks for sharing the fix.

xbox361
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Dec 16, 2010 8:36 pm

Re: 1.5.12 joomla.filesystem.file FTP bug?

Post by xbox361 » Fri Dec 17, 2010 9:55 am

Not arguable at all. And if you took the trouble to read the bug tracker ad the changelog you would see why the change was made and what the correction to the new code should be. I’m very sad to see a developer thinking that chmod 777 can ever be a good solution. I’m thinking I’m very glad I don’t use your extensions if you think 777 is a good solution.
xbox361

Advertisement

Locked

Return to “Joomla! 1.5 Bug Reporting”