After this commit (found via git bisect, issue #1399098: The WYSIWYG plugin does not respect File directory path, what options do we have?), if a site doesn't have a value set for wysiwyg_upload_directory, at some point when transitioning between PHP and js and back to PHP, the null returned by media_variable_get() is transformed into a string, resulting in the inability to properly upload files via the media browser:

File temporary://p17auo77li1d5l1n0uoaa1os23l04.tmp could not be copied, because the destination directory public://null is not configured correctly.

Throwing a dvm($params['file_directory'] === 'null'); at the top of the media_browser() function makes it clear that the file_directory query parameter is coming through as the string 'null'.

Comments

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new729 bytes

Since media_variable_get is being used, a default value for wysiwyg_upload_directory should probably be set in media_variable_default.

Something like the attached patch?

jhedstrom’s picture

Patch in #1 works for me, aside from a simple typo (= instead of =>). Fix attached.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community
ParisLiakos’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.