Got the following error:

Recoverable fatal error: Argument 2 passed to url() must be an array, string given, called in /server/modules/vimeo_link_formatter/vimeo_link_formatter.module on line 109 and defined in url() (line 2100 of /server/includes/common.inc).

With this section of code, from line 101 to 115 (I added the three echo commands to see what values were of variables):

$ret = array();
foreach ($items as $delta => $item) {
// Extract the ID from the URL.
preg_match('@http(?:s)?://(www\.)?vimeo\.com/([0-9]+)@', $item['url'], $matches);
if ($id = $matches[2]) {
echo "id=",$id,"--";
echo "matches=",$matches[2],"-(ID should equal MATCHES--";
echo "url=",$url,"--";
$url = url("http://player.vimeo.com/video/$id", $url);
$ret[] = array('#markup' => "

");
}
else {
// The link is not a valid Vimeo.com link.
// @todo Handle this better, perhaps with node-form validation or more
// formatter settings?
}
}
return $ret;

Output of echo commands (diagnostic) was:

id=34786324--matches=34786324-(ID should equal MATCHES--url=Array--id=34786324--matches=34786324-(ID should equal MATCHES--url=Array--id=34786324--matches=34786324-(ID should equal MATCHES--url=Array--id=34786324--matches=34786324-(ID should equal MATCHES--url=http://player.vimeo.com/video/34786324--

Comments

den33775’s picture

Issue summary: View changes

..

den33775’s picture

Fixed it by changing offending line, $url variable to a new variable so not expected to be an array (just called it $url2 instead of $url), as follows:

$url2 = url("http://player.vimeo.com/video/$id", $url);
$ret[] = array('#markup' => "

");

WorldFallz’s picture

Status: Active » Fixed

this should already be fixed in the current dev.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

..