? Pending

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
18 Jul 2014
  • No dependence on Mootools
  • Support both jQuery and Mootools version of Chosen (whichever is installed will just work)
  • Remove/consolidate unneeded/repetitious code
  • Fix bugs such as uninitialized variables

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33965&start=0

test instructions

This file is used only by the 'images' view of com_media which is used inside an iframe in a modal dialog when the 'Image' button is clicked under an editor. So this can be tested on any page that uses an editor such as the 'Edit Article' page. The script manages such things as changing directories (using the select or the 'up' button) and it handles generating the img tag (or figure tag set) and inserting into the editor. So you can test that those functions are behaving as usual.

avatar okonomiyaki3000 okonomiyaki3000 - open - 18 Jul 2014
avatar okonomiyaki3000 okonomiyaki3000 - change - 18 Jul 2014
Title
Update the ImageManager js object
[#33965] Update the ImageManager js object
avatar okonomiyaki3000
okonomiyaki3000 - comment - 25 Jul 2014

Tracker has some test instructions.

avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar brianteeman brianteeman - change - 2 Sep 2014
Category JavaScript
avatar brianteeman brianteeman - change - 17 Oct 2014
The description was changed
avatar brianteeman
brianteeman - comment - 17 Oct 2014

I added the test instructions from joomlacode to the original post

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar nicksavov nicksavov - change - 17 Oct 2014
Labels Added: ?
avatar redcomponent redcomponent - test_item - 17 Oct 2014 - Tested successfully
avatar ronnikc
ronnikc - comment - 17 Oct 2014
avatar ronnikc
ronnikc - comment - 17 Oct 2014

The code was ofcause filtered out - check it out on the testbed link.

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar AnishaVora
AnishaVora - comment - 17 Oct 2014

@test,
This works when adding the image for the first time, When i re-edit the article already containing the image, one javascript error is coming when i open image modal by clicking on the "image" button.
It does not hamper the functionality, but error is coming so attaching the screen-shot of the error here.screen shot 2014-10-17 at 05 14 31

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar AnishaVora AnishaVora - test_item - 17 Oct 2014 - Tested unsuccessfully
avatar tairedweb
tairedweb - comment - 17 Oct 2014

@test it happen when i'm double-click on folder in frame
screen shot 2014-10-17 at 05 22 02

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar tairedweb tairedweb - test_item - 17 Oct 2014 - Tested unsuccessfully
avatar superfoght
superfoght - comment - 17 Oct 2014

I see the same issues as AnishaVora and tairedweb



This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 17 Oct 2014

Thanks guys. I'll try to have a look at to these issues next week.

avatar anibalsanchez
anibalsanchez - comment - 17 Oct 2014

@test OK, but:

TypeError: u is undefined
...\/)?(([^:\/?#])(?::(\d))?)((\/(?:^?#)\/?)...


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.*

avatar brianteeman brianteeman - change - 17 Oct 2014
Category JavaScript JavaScript Media Manager
avatar okonomiyaki3000
okonomiyaki3000 - comment - 20 Oct 2014

I can't seem to duplicated these errors in chrome. I'll try other browsers. What browsers are y'all using?

avatar okonomiyaki3000
okonomiyaki3000 - comment - 20 Oct 2014

Nevermind, I'm finding them now.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 20 Oct 2014

This ought to fix it. Do you ever look at some code you wrote a while ago and think: how did this even work at all?

avatar anibalsanchez
anibalsanchez - comment - 8 Nov 2014

@test, tested on Joomla 3.3.6, 'Edit Article'

  • Changing directories OK
  • Using the select or the 'up' button, OK
  • Select a directory, FAILED
ReferenceError: com_content is not defined
ImageManager.setFolder(this.options[this.selectedIndex].value, com_content, 55)
  • Generating the img tag (or figure tag set) and inserting into the editor, OK
avatar okonomiyaki3000
okonomiyaki3000 - comment - 10 Nov 2014

@anibalsanchez the 'Select a directory' bug is not related to this file (try it on a clean install, you'll see) so I'd prefer not to include it in this PR. The bug is actually in MediaModelManager (administrator/components/com_media/models/manager.php). It's a very easy fix:

$list = JHtml::_('select.genericlist', $options, 'folderlist', 'size="1" onchange="ImageManager.setFolder(this.options[this.selectedIndex].value, '.$asset.', '.$author.')" ', 'value', 'text', $base);

should change to

$list = JHtml::_('select.genericlist', $options, 'folderlist', 'size="1" onchange="ImageManager.setFolder(this.options[this.selectedIndex].value, ' . json_encode($asset) . ', ' . $author . ')" ', 'value', 'text', $base);

I'll put in a different PR for that one.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 10 Nov 2014

Here #5077

avatar anibalsanchez
anibalsanchez - comment - 10 Nov 2014

@test Ok with #3919 and #5077

avatar brianteeman brianteeman - change - 1 Jan 2015
Labels Removed: ?
avatar Chalkin
Chalkin - comment - 6 Mar 2015

@test
Joomla 3.4.0
Google Chrome 40.0.2214.111 Mac
with com_articles - New Article

OK:

  • Browsing through folders -> OK
  • Using "UP" Button -> OK
  • Selecting Image -> OK
  • Image Path is applied to field "Image URL" after selecting -> OK
  • Selecting Image and Inserting into Joomla Article -> OK

Error:

avatar Chalkin Chalkin - test_item - 6 Mar 2015 - Tested unsuccessfully
avatar okonomiyaki3000
okonomiyaki3000 - comment - 7 Mar 2015

@chalkin is this not fixed by #5077 ?

avatar Chalkin
Chalkin - comment - 7 Mar 2015

@okonomiyaki3000 the fix from #5077 is already applied in joomla 3.4.0 - but it's not fixing the problem with the current directory not showing up.

Specific the fixed line in #5077 I'm refering to:
administrator/components/com_media/models/manager.php Line 104

$asset = htmlspecialchars(json_encode(trim($input->get('asset', 0, 'cmd'))));
avatar peterpeter
peterpeter - comment - 8 Mar 2015

In this modal window, when I switched in a subfolder and upload an image it is allways stored in the images root folder, no matter in wich subfolder I actually am. This happend with and without this patch in J-3.4. As this behaviour is not in J-3.3.6, it seems to be a 3.4 bug.

@okonomiyaki3000
I've searched a while and found this bug not reported so far, so you can smash another bug with this PR.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.
avatar roland-d
roland-d - comment - 20 Aug 2015

@okonomiyaki3000 Could you please have a look at the issues mentioned? Thank you.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 25 Aug 2015

Rebased with latest staging but couldn't reproduce the bug. Everything is working perfectly in Chrome. @Chalkin @peterpeter , what browsers are you guys using?

avatar okonomiyaki3000
okonomiyaki3000 - comment - 25 Aug 2015

Ah, you are using Chrome. Well, I can't imagine why you got this error. Any messages in Chrome's console?

avatar Chalkin
Chalkin - comment - 25 Aug 2015

I'm using chrome on mac (current chrome) - I will check in the evening if the problem still exists since it's been a while.

avatar peterpeter
peterpeter - comment - 25 Aug 2015

I've used FF on windows....I check it later on too, with different browsers

avatar anibalsanchez
anibalsanchez - comment - 25 Aug 2015

I have reproduced the reported issue.

If you navigate to a subfolder and upload an image, it works Ok.

However, if you choose a subfolder from "Directory", it shows the subfolder. But, when you upload an image, it is saved in / and jumps to /.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 25 Aug 2015

Thanks! That might help. I'll try it tomorrow.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 26 Aug 2015

Thanks for your help guys, this should fix it. The problem was that, in some cases a url was getting double encoded. There's an iframe that contains the current directory list and it gets changed when changing directories. This can happen by a link (clicking a folder in the list) which worked fine because it was a perfectly "natural" process. It can also happen by javascript (a result of using the folder select or 'up' button). The javascript way had a problem because I was forming the query string part of the url by using JQuery's $.param() function. That function is pretty convenient and even does url encoding automatically. You'd think that would be perfect but then the next step is to assign the url to frame.location.href. You might not know this (I didn't) but assigning a url to location.href also automatically url encodes. So this was resulting in a double encoding. Specifically, the / character was getting encoded as %2F and then that was getting encoded as %252F which is obviously a mess that makes no sense at all.

So now it's fine.

avatar anibalsanchez
anibalsanchez - comment - 26 Aug 2015

@text OK

avatar anibalsanchez anibalsanchez - test_item - 26 Aug 2015 - Tested successfully
avatar zero-24 zero-24 - alter_testresult - 26 Aug 2015 - tairedweb: Not tested
avatar zero-24 zero-24 - alter_testresult - 26 Aug 2015 - AnishaVora: Not tested
avatar zero-24 zero-24 - alter_testresult - 26 Aug 2015 - Chalkin: Not tested
avatar zero-24 zero-24 - alter_testresult - 26 Aug 2015 - redcomponent: Not tested
avatar okonomiyaki3000
okonomiyaki3000 - comment - 27 Aug 2015

conflicts, eh? We'll see about this...

avatar okonomiyaki3000
okonomiyaki3000 - comment - 27 Aug 2015

Rebased with staging. Should merge now.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 27 Aug 2015

@anibalsanchez I think you meant to say @test OK

avatar anibalsanchez
anibalsanchez - comment - 27 Aug 2015

Ahhh fat fingers!!! @test OK

avatar zero-24 zero-24 - alter_testresult - 27 Aug 2015 - anibalsanchez: Not tested
avatar zero-24 zero-24 - alter_testresult - 27 Aug 2015 - anibalsanchez: Tested successfully
avatar designbengel designbengel - test_item - 24 Oct 2015 - Tested successfully
avatar designbengel
designbengel - comment - 24 Oct 2015

I have tested this item :white_check_mark: successfully on 95a3099

Tested successfully on Chrome / Os X


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/3919.

avatar zero-24
zero-24 - comment - 24 Oct 2015

@okonomiyaki3000 can you fix merge conflicts? Than we can RTC based on @designbengel and @anibalsanchez 's tests :smile:

avatar dgt41
dgt41 - comment - 24 Oct 2015

This can be easily fixed by a commiter:
remove JHtml::_('script', 'media/popup-imagemanager.min.js', true, true); from administrator/components/com_media/views/images/view.html.php and push just the scripts

avatar roland-d roland-d - change - 3 Nov 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-11-03 18:06:02
Closed_By roland-d
avatar roland-d roland-d - close - 3 Nov 2015

Add a Comment

Login with GitHub to post a comment