Media Root folder re-append public:// on form settings save.
- The reproduce the issue go to the Media browser plus settings page
- Populate the "Media Root folder" with some dir name (ex. media-root)
- click save
- when the page is loaded again you will see the "public://media-root " as a value of Media Root folder
- I change the public://media-root to public://media-root-1 and click save
- than the value is changed to public://public://media-root-1

Also I am not sure is needed at all to store the "public" part in the setting...May be is better just to store the directory name only?!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boyan.borisov’s picture

I prepared a patch that resolve the issue. It just removes the schema wrapper from the setting value and seems to work fine for me.

ndobromirov’s picture

The patch above creates an issue with the subfolders moving funtionality, because the media_browser_plus_construct_dir_path method uses the variable media_root_folder's value internaly. Making the patch in comment 1 to copy files from destination to destination directory instead of source to destination directory by setting the variable's value in the beginning of media_browser_plus_move_root_folder method.

Sending a new patch.

shadysamir’s picture

Patch from #2 gets rejected but applying it manually it solves the problem

ndobromirov’s picture

It is probably patched against an older git revision.

das-peter’s picture

Thank you very much for the patch.
May I ask you to you give MBP 3.0 beta1 a try?
The whole scheme stuff changed during the rewrite from 2.x to 3.x to properly support public and private files.
My goal is to discontinue the support for version 2.x as soon as possible.

N20’s picture

both patches reject. how to remove the Media Root folder and its form element?

yannickoo’s picture

kenorb’s picture

Status: Active » Needs review
salvis’s picture

Status: Needs review » Closed (outdated)