?

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
24 May 2014

How to test

  1. Backend login
  2. upload a image (com_media)
  3. upload the same image again (com_media)
  4. You get an error message "Error: File already exists"
  5. apply patch
  6. access the com_media options
  7. read and understand the tooltip of the option "Allow overwriting files"
  8. enable the option "Allow overwriting files"
  9. make sure that you have the permission to delete files (core.delete) for com_media
  10. try to upload a image (that allready exists) again.

Expected Behavior (after patch)

The old file will delete and the new one is there. (if the user have core.delete for com_media)
Note that if the upload fails in any reasons the file is deleted and can't be restore by Joomla.

Joomla Feature Tracker

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33777&start=675

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar zero-24 zero-24 - open - 24 May 2014
avatar zero-24 zero-24 - change - 24 May 2014
Labels
avatar zero-24 zero-24 - change - 24 May 2014
Labels Added: ?
avatar zero-24 zero-24 - change - 24 May 2014
Title
Allow override files com_media
[#33777] Allow override files com_media
avatar losedk
losedk - comment - 25 May 2014

Hi

Just tested the patch. I can't seem to override the files. But I tried to change the if statement on line 95 in administrator/components/com_media/controllers/file.php to == instead of === - That seemed to do the trick

if ($params->get('override_files', 0) === 1 && JFactory::getUser()->authorise('core.delete', 'com_media'))
avatar zero-24
zero-24 - comment - 25 May 2014

Thanks @losedk i have fix this :+1:

avatar Buddhima
Buddhima - comment - 31 May 2014

Tested and worked fine!

avatar Bakual Bakual - change - 31 May 2014
Title
[#33777] Allow override files com_media
[#33777] Allow overwrite files com_media
avatar pe7er
pe7er - comment - 31 May 2014

I have a problem with this patch:
On Debian 7 + Apache2 + PHP 5.4.4 + Error Reporting to "Development" it seems not to work correctly.

Allow overwriting files: ON -> blank screen.
Allow overwriting files: OFF -> white screen with "Error - File already exists" message on top of screen.

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

avatar zero-24
zero-24 - comment - 1 Jun 2014

@Buddhima thanks for your test!

@pe7er

Allow overwriting files: ON -> blank screen

hmm. Please make sure that the blank screen is not if you delete a file with the current method. (Delete Button)

avatar losedk
losedk - comment - 6 Jun 2014

Btw could we add a message stating that the file has been overwritten?

avatar zero-24
zero-24 - comment - 6 Jun 2014

good point @losedk done :+1:

avatar losedk
losedk - comment - 6 Jun 2014

@zero-24 Great! :) nice job!

avatar brianteeman
brianteeman - comment - 7 Jun 2014

The new language strings are not real English. I'm mobile right now but will suggest alternatives later.

avatar brianteeman
brianteeman - comment - 7 Jun 2014

Suggested some alternate language strings in better english. However I have left the word override although I suspect a better word is either replace or overwrite

avatar ChelseaStats
ChelseaStats - comment - 7 Jun 2014

Not sure you'd want this +COM_MEDIA_ERROR_FILE_EXISTS_OVERRIDE= if the user has permissions, file exists and override/overwrite is set to yes. the message should surely be
'file successfully replaced!' ?

avatar zero-24
zero-24 - comment - 7 Jun 2014

thanks @brianteeman i change from override to overwrite and add your strings.
thanks @ChelseaStats You are right. I have change the string.

avatar losedk
losedk - comment - 11 Jul 2014

any news on this @zero-24 ? Seems like we are just lacking testers?

avatar zero-24
zero-24 - comment - 15 Jul 2014

Is this a part of the new media manager? @Buddhima @losedk

Woops deleted the old response :-D

avatar losedk
losedk - comment - 15 Jul 2014

Well it should be :)

avatar Bakual
Bakual - comment - 15 Jul 2014

As far as I understood the original plan in the media manager was to not allow overwriting. A hash would prevent it.
Since it's now changed to be without hash in the filename, I don't know the current state. There is probably no logic like in this PR here. So you still can test this and we can merge.

avatar Buddhima
Buddhima - comment - 15 Jul 2014

Hi,
I think it'll be possible to add this feature in my implementation as well.
Thanks!

avatar zero-24
zero-24 - comment - 20 Jul 2014
avatar zero-24 zero-24 - change - 20 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-20 13:53:02
avatar zero-24 zero-24 - close - 20 Jul 2014
avatar zero-24 zero-24 - close - 20 Jul 2014
avatar zero-24 zero-24 - head_ref_deleted - 20 Jul 2014
avatar Buddhima
Buddhima - comment - 20 Jul 2014

@zero-24 You're welcome!

avatar RustyIngles
RustyIngles - comment - 23 Jul 2015

Works great, thank you!


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

avatar RustyIngles RustyIngles - test_item - 23 Jul 2015 - Tested successfully

Add a Comment

Login with GitHub to post a comment