Download & Extend

convert FILE_ENTITY_DEFAULT_ALLOWED_EXTENSIONS to the new variable

Project:Media
Version:7.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I got this notice:

Notice: Use of undefined constant FILE_ENTITY_DEFAULT_ALLOWED_EXTENSIONS - assumed 'FILE_ENTITY_DEFAULT_ALLOWED_EXTENSIONS' i media_variable_default() (row 133 in /media/includes/media.variables.inc).

Comments

#1

which file_entity version you have?

#2

I got this too with 7.x-2.0-unstable7+2-dev File Entity after install

#3

Title:notice warning» convert FILE_ENTITY_DEFAULT_ALLOWED_EXTENSIONS to the new variable
Version:7.x-2.0-unstable7» 7.x-2.x-dev
Priority:minor» normal

Yeap, i just made a commit there that swaps the constant with a variable.
need to convert it in media module as well

something like this
http://drupalcode.org/project/file_entity.git/blobdiff/3779389cffdbb49a0...

#4

Status:active» needs review
AttachmentSizeStatusTest resultOperations
1846674-media-file_entity_default_allowed_extensions.patch799 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 5 pass(es).View details

#5

Status:needs review» fixed

thanks a lot mrfelton
http://drupalcode.org/project/media.git/commit/9eeac2e

#6

Status:fixed» needs review

There was one place this is called in media.module, patch attached with a variable_get('file_entity_default_allowed_extensions') seems to sort it out.

AttachmentSizeStatusTest resultOperations
1846674-media-file_entity_default_allowed_extensions-6.patch780 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 5 pass(es).View details

#7

Status:needs review» needs work

Nice catch jpstrikesback!
But maybe we should use media_variable_get for consistency

#8

Status:needs work» needs review

> maybe we should use media_variable_get for consistency

No that doesn't make sense here - we are trying to compare against the value provided by file_entity, not the value of one of media's variables. I think the above patch is correct, although the standard is to include the default value in the vall to variable_get. Patch updated.

AttachmentSizeStatusTest resultOperations
1846674-media-file_entity_default_allowed_extensions-8.patch863 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 5 pass(es).View details

#9

And good catch on the default value, wasn't sure if it was needed but it can only help.

#10

Status:needs review» reviewed & tested by the community

Ah, i am sorry, i didnt notice the context
You are right thanks again

#11

Status:reviewed & tested by the community» fixed

http://drupalcode.org/project/media.git/commit/9d12eb6
Thanks both!

#12

Status:fixed» closed (fixed)

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

nobody click here