If you try to

$config = graphapi_default_config();
$element[0]['relation']['graph']['#markup'] = theme('graphapi_dispatch', array('graph' => $relation_graph, 'config' => $config));

Then your $config is missing the ['engine'] component, and the graph will fail. Unfortunately, the wrong error is given: "No Graph API render engines enabled. Check your !modules_page for a Graph API render engine.", even if there ARE engines enabled.

Here is a patch for the correct message logic (and also a grammatical mistake).

I would also think it would make sense to choose an engine in the default settings, if one is available, but I thought there might be some reason you don't do that, so I left it out.

Comments

clemens.tolboom’s picture

Assigned: Unassigned » clemens.tolboom
clemens.tolboom’s picture

Status: Needs review » Fixed
StatusFileSize
new1.9 KB
new2.27 KB

Pushed the patch below.

@naught101 thanks for reporting and the initial patch.

[edit]
We now have always a default if available.
[/edit]

Status: Fixed » Closed (fixed)

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