Parse error: syntax error, unexpected '=', expecting ')' in media_mover.inc on line 17

Comments

steingard’s picture

Title: installation problem » same here

I'm not sure if this helps by way of getting someone on this, but I have the same issue. I'd really like to use this module to batch convert a buttload of WAV files to MP3 using ffmpeg.

arthurf’s picture

error is fixed,

this module now has a configuration to handle more audio settings than previously. I haven't set it up to just do audio, however that's totally possible.

blantz’s picture

where is this fixed? I just downloaded the module and am getting this error.

does this module require php 5? I'm currently using PHP Version 4.4.4-8+etch3

Thanks,
Bart

arthurf’s picture

This error was fixed. As stated on the page, all development is happening in the DRUPAL-5 branch. I've just released a snap shot which does have this code fix.

Asper the php4 vs 5, while I didn't intend for php4 compatibility, it may work. The current thinking in Drupal developer community is to push toward php5 because there are some severe limitations of php4. While Debian is great, you're probably better off running a backport of php5.

good luck!

arthurf’s picture

Title: same here » Installation issues
Status: Active » Closed (fixed)

fixing title, changing status

luxvisuals’s picture

Parse error: syntax error, unexpected '=', expecting ')' in /home/luxvis/public_html/modules/media_mover/media_mover.inc on line 22

I'm getting the same error for 5.x-0.2-2 and 5.x-1.x-dev

The code:
function media_mover_media_mover($op, $action = null, $configuration = null, &$file = array(), $running_config = null ) {
looks all right to me... any suggestions? Thanks for this great module!

luxvisuals’s picture

Status: Closed (fixed) » Active

Setting this back to active

robloach’s picture

After Media Mover installation, I experienced this warning:

user warning: Invalid default value for 'status' query: CREATE TABLE sandbox_media_mover_files ( `mmfid` int(11) DEFAULT null, `nid` int(11) DEFAULT null, `fid` int(11) NOT NULL default '0', `cid` int(11) default NULL, `harvest_module` varchar(225) default NULL, `harvest_action` varchar(128) default NULL, `harvest_file` varchar(128) default NULL, `process_module` varchar(128) default NULL, `process_action` varchar(128) default NULL, `process_file` varchar(128) default NULL, `storage_module` varchar(128) default NULL, `storage_action` varchar(128) default NULL, `storage_file` varchar(128) default NULL, `url` varchar(255) NOT NULL default '', `status` VARCHAR(48) NOT NULL default NULL, `data` blob NOT NULL, PRIMARY KEY (`mmfid`), ) ; in includes\database.mysql.inc on line 172.

robloach’s picture

The problem with:

function media_mover_media_mover($op, $action = null, $configuration = null, &$file = array(), $running_config = null ) {

Is that differing versions of PHP handle the objects passed by reference differently with default values. If you change it to the following, you should be fine:

function media_mover_media_mover($op, $action = null, $configuration = null, $file = array(), $running_config = null ) {
{

As you see, I'm removing the '&' from $file.

cbosner’s picture

user warning: Invalid default value for 'status' query: CREATE TABLE sandbox_media_mover_files ( `mmfid` int(11) DEFAULT null, `nid` int(11) DEFAULT null, `fid` int(11) NOT NULL default '0', `cid` int(11) default NULL, `harvest_module` varchar(225) default NULL, `harvest_action` varchar(128) default NULL, `harvest_file` varchar(128) default NULL, `process_module` varchar(128) default NULL, `process_action` varchar(128) default NULL, `process_file` varchar(128) default NULL, `storage_module` varchar(128) default NULL, `storage_action` varchar(128) default NULL, `storage_file` varchar(128) default NULL, `url` varchar(255) NOT NULL default '', `status` VARCHAR(48) NOT NULL default NULL, `data` blob NOT NULL, PRIMARY KEY (`mmfid`), ) ; in includes\database.mysql.inc on line 172.

You need to change the status column to either allow NULL or change the default value to ''. Right now it reads NOT NULL default NULL

arthurf’s picture

There was some legacy stuff in the install file and the content in the updates had not yet made it back to the origional install stuff. I'm in the process of cleaning things up right now- can you give the 3-1 release a try and make sure to run the update script? Thanks

budda’s picture

Version: 5.x-0.1 »
Priority: Normal » Critical

Just been tripped up on the whole &$file = array(), not working on PHP4 issue.

Can you at least put a notice on the project homepage to say this module needs PHP5 or something? Otherwise it will be left to people who might not know where to look, to resolve this problem them selves, and get frustrated.

Our fix was to remove the default value for the referenced $file object.

arthurf’s picture

I'll put a note on the project page which indicates the need for php5 +. I'm wondering if I can just remove the &$file = array() entirely- it may mean rewriting the function calls in the media_mover_api module, but it shouldn't be that many. If I take this on, would you be willing to do some testing?