? Failure

User tests: Successful: Unsuccessful:

avatar zero-24 zero-24 - open - 2 May 2014
avatar wilsonge
wilsonge - comment - 2 May 2014

As I can't access the trackers (usual broken stuff) nor read german (should have paid more attention at school) how do I replicate this?

avatar sovainfo
sovainfo - comment - 3 May 2014

See #32032 in the Feature tracker, not broken anymore!
You may blame the J!Tracker Application for transmitting this comment.

avatar sovainfo
sovainfo - comment - 3 May 2014

Just try uploading anything to a folder.

You may blame the J!Tracker Application for transmitting this comment.

avatar zero-24
zero-24 - comment - 3 May 2014

@wilsonge
There are different reports that uploading to a sub folder (e.g. images/sampledata/parks) upload the image to the /images folder.

So you can do the following:
1) login to the backend
2) access the media manager
3) navigate to a sub folder
4) try uploading a image
5) apply patch
6) test again

Thanks.

avatar sovainfo
sovainfo - comment - 3 May 2014

#test Confirm issue and resolution.
Folder is now created at the expected location, image is uploaded to current folder.
You may blame the J!Tracker Application for transmitting this comment.

avatar sovainfo
sovainfo - comment - 3 May 2014

For consistency would suggest '$this->input->post->get(' instead of '$this->input->get->get('
You may blame the J!Tracker Application for transmitting this comment.

avatar Bakual
Bakual - comment - 3 May 2014

For consistency would suggest '$this->input->post->get(' instead of '$this->input->get->get('

This depends if the folder is given in the URL (GET request) or is coming from the form data (POST) imho. The proposed code looks specifially in the URL while your suggestion would look in the form data.

avatar sovainfo
sovainfo - comment - 4 May 2014

Not my line of expertise. Find it strange, both fields (return-url and folder) are hidden fields, one is taken from post, the other from get. Makes me wonder, especially when something doesn't work as expected.

avatar gwsdesk
gwsdesk - comment - 5 May 2014

@test
The patch worksforme. Image is now loaded in selected folder

avatar losedk
losedk - comment - 5 May 2014

Test. The PR fixes the problem!

avatar Bakual
Bakual - comment - 5 May 2014

@sovainfo has a valid point. There is a hidden folder field in the form, but it's not populated with a value. That's the main reason why the current code fails.
The script gets two inputs, one from GET (with the correct value) and one from POST (with an empty value), and the POST one overrides the one from GET.
While this fix works, I would actually prefer it if the form field would properly updated with the correct value.
It takes the value from $this->state->folder, see https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_media/views/media/tmpl/default.php#L64 and it looks like this state isn't properly updated when traversing directories.

There are also other places where this state is used, so I gess we may well have other bugs with that.

avatar gwsdesk
gwsdesk - comment - 6 May 2014

The patch for File uploads. However the issue is also applicable for creating subfolders. If you create a subdirectory it is placed in the root (I tested that) and not in the directory where you created the sub. I guess Thomas this is one of those places where it indeed bugs as well with that

avatar sovainfo
sovainfo - comment - 6 May 2014

Weird, as reported, creating subfolders worked in my environment.

avatar n9iels
n9iels - comment - 6 May 2014

creating sub folders works only fore me when I upload a file. Like i described in the tracker item: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33413

avatar gwsdesk
gwsdesk - comment - 6 May 2014

Exactly the behavior I also experienced that's why I posted. I think
that is because of the double "get" as described by Thomas
On 5/6/2014 4:22 PM, n9iels wrote:

creating sub folders works only fore me when I upload a file. Like i
described in the tracker item:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33413


Reply to this email directly or view it on GitHub
#3551 (comment).

avatar illovo
illovo - comment - 7 May 2014

Here's another a fix or Re:Later for "If you create a subdirectory it is placed in the root (I tested that) and not in the directory where you created the sub".

  1. a CSS class is missing to show the parent folder in grey uneditable INPUT (/administrator/components/com_media/views/media/tmpl/default.php)
  2. a JQuery error in /media/media/js/mediamanager.js. value is assigned to the index of an INPUT-element in a collection instead to the INPUT-element (JQuery object) itself.

We've tested all three fixes with J!3.2.4 and 3.3.0

Why ...get->get...? Because "folder=..." is added to the action URL by JavaScript, that's transmitted by GET..

http://www.joomlaportal.de/joomla-3-x-installation/309865-sammelthread-joomla-3-3-0-released-5.html#post1535107

avatar Bakual
Bakual - comment - 7 May 2014

Why ...get->get...? Because "folder=..." is added to the action URL by JavaScript, that's transmitted by GET..

The thing is that the current JInput->get('folder') would actually work fine if the empty hidden folder field wasn't present in the form. We don't really need JInput->get->get('folder').
There are two ways to properly fix this:

  • Remove the hidden folder field.
  • Fix the hidden folder field and remove the folder parameter from the URL (as it's not needed anymore).
avatar sovainfo
sovainfo - comment - 7 May 2014

Was able to create subfolders multiple levels deep. Also in other folders. Changed the statement into post and back to original. Made no difference, it kept working!

So, I recreated a j33demo environment. Verified existance of the bug, it exists. Added ->get, could upload image. Could also create subfolder, but only after uploading image.

Didn't test suggestion of ilovo brcause I don't like the folder in the url. Would like to have it in the post!

avatar gwsdesk
gwsdesk - comment - 8 May 2014

Thomas,
If what you write is the best option than please implement so we can test this and get over it? I also do not like illovo's suggestion because of the url and I have same experience in testing at present as Sovainfo has so let's follow Thomas suggestion ?

avatar Bakual
Bakual - comment - 8 May 2014

Please test #3575
Looks like the fix in the forum thread mentioned by @illovo is indeed the correct one.

avatar Bakual
Bakual - comment - 8 May 2014

Fixed with PR #3575
Thanks all!

avatar Bakual Bakual - change - 8 May 2014
The description was changed
Title
Fix: Cannot upload file to sub-folder in Media Manager
[#33687] Fix: Cannot upload file to sub-folder in Media Manager
Description <p>Tracker:<br><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33687&amp;start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33687&amp;start=0</a><br><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33413&amp;start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33413&amp;start=0</a></p> <p>Fix based on (german):<br><a href="http://www.joomlaportal.de/joomla-3-x-installation/309865-sammelthread-joomla-3-3-0-released-2.html#post1534645">http://www.joomlaportal.de/joomla-3-x-installation/309865-sammelthread-joomla-3-3-0-released-2.html#post1534645</a><br><a href="http://www.joomla-bugs.de/forum/index.php?topic=582.0">http://www.joomla-bugs.de/forum/index.php?topic=582.0</a></p> <p>Tracker:<br><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33687&amp;start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33687&amp;start=0</a><br><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33413&amp;start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33413&amp;start=0</a><br> one more:<br><a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_id=8103&amp;tracker_item_id=33692">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_id=8103&amp;tracker_item_id=33692</a></p> <p>Fix based on (german):<br><a href="http://www.joomlaportal.de/joomla-3-x-installation/309865-sammelthread-joomla-3-3-0-released-2.html#post1534645">http://www.joomlaportal.de/joomla-3-x-installation/309865-sammelthread-joomla-3-3-0-released-2.html#post1534645</a><br><a href="http://www.joomla-bugs.de/forum/index.php?topic=582.0">http://www.joomla-bugs.de/forum/index.php?topic=582.0</a></p>
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-05-08 15:54:07
Labels Added: ? ?
avatar Bakual Bakual - close - 8 May 2014
avatar Wequips
Wequips - comment - 3 Jul 2015

Could anyone explain to me what a patch is. I'm struggling with the same issue as you all do. The Media Manager. The final step is: apply patch. But I don't know how to do that...

avatar sovainfo
sovainfo - comment - 3 Jul 2015

Sounds like you need to apply #3575 using com_patchtester.

avatar Wequips
Wequips - comment - 3 Jul 2015

Thanks for messaging!
And this sounds already difficult for me...

avatar Bakual
Bakual - comment - 3 Jul 2015

This issue is resolved. Updating to the lastest version of Joomla should fix this.

If not, please open a new issue so it can get fixed.

avatar Wequips
Wequips - comment - 3 Jul 2015

I have this version: Joomla! 3.4.1

Two weeks ago I was able to make a sub-folder, but now I can't anymore...

avatar wilsonge
wilsonge - comment - 3 Jul 2015

Then you should update to 3.4.3 - which got released yesterday!

avatar Wequips
Wequips - comment - 3 Jul 2015

OK, I see. Solved. Thaks a lot!

Add a Comment

Login with GitHub to post a comment