Hello i get this error when i try to enable this module.

Parse error: syntax error, unexpected ';', expecting ')' in /home/xxxxx/public_html/sites/all/modules/soundcloud_tools/soundcloud_api.module on line 96

I deleted the module. Love to use it.

thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

WhereverPanda’s picture

I'm getting this error as well. This module would be a LIFE SAVER if it worked...

mjonesdinero’s picture

Hi every one did you upload the soundcloud in https://github.com/mptre/php-soundcloud/downloads and put it on /sites/all/modules/soundcloud_tools folder?

mjonesdinero’s picture

Status: Active » Needs review

also please reply to me if you are still getting error when you have already put the Services folder..
attach
patch apply to git off of the error

mjonesdinero’s picture

sorry here is the patch

WhereverPanda’s picture

Thank you so much for the patch, it seems to do something, although now there is a new error which breaks the whole site:

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in ........./soundcloud_tools/Services/Soundcloud.php on line 685

mjonesdinero’s picture

hi are you testing this in your localhost or in a live site? because in my localhost i have no error on this..
and it is running smoothly

WhereverPanda’s picture

I am building online, so that might be where the issue is.

mjonesdinero’s picture

HI please update the file

/soundcloud_tools/Services/Soundcloud.php line 685

current code
$postData = array_map(function ($track) {

please change to
$postData = array_map(function ($track)) {

WhereverPanda’s picture

Damn, no sorry, man. It still doesn't seem to help the problem. :/

mjonesdinero’s picture

is the problem still exists? hmff.. is the problem the same from what you have stated in #5?

mjonesdinero’s picture

line 682-701.. please change the current function with this one...

public function updatePlaylist($playlistId, $trackIds, $optionalPostData = null)
    {
        $url = $this->_buildUrl('playlists/' . $playlistId);
        $postData = array_map(function($track){ return 'playlist[tracks][][id]=' . $track;} , $trackIds);

        if (is_array($optionalPostData)) {
            foreach ($optionalPostData as $key => $val) {
                array_push($postData, 'playlist[' . $key . ']=' . $val);
            }
        }

        $postData = implode('&', $postData);
        $curlOptions = array(
            CURLOPT_CUSTOMREQUEST => 'PUT',
            CURLOPT_HTTPHEADER => array('Content-Length' => strlen($postData)),
            CURLOPT_POSTFIELDS => $postData
        );

        return $this->_request($url, $curlOptions);
    }
mjonesdinero’s picture

also what php version are you using?

because if it is 5.2 it will make an error.. you must update the version to 5.3

nepasisiht’s picture

Just chipping in to say that comment #4's patch fixed a white screen issue on a PHP 5.3 server, so thank you.

WhereverPanda’s picture

At least I know there is hope. On my test domain I have PHP Version 5.2.17, but I know most have 5.3.
I'll have to set up on a new server and check again to see if I can get it working!!

mjonesdinero’s picture

@WhereverPanda
just post a feedback here if there are some issue

WhereverPanda’s picture

It's been a long time, but I have finally started playing with this module again, and it works BEAUTIFULLY now. Seriously, awesome module - and it works flawlessly.
The only thing I am personally missing is an option to use an HTML5 player instead of flash. Will you by any chance be looking into this in the future?