Don't create the /sparql menu item if the endpoint is disabled
drewish - May 15, 2009 - 07:10
| Project: | SPARQL |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I found it very confusing/buggy that the "SPARQL query" menu item was created after enabling the sparql module was enabled, but when I clicked on it found a 403 page not found. Thinking this was a bug I pulled up the page callback and found:
<?php
function sparql_endpoint() {
if (!SPARQL_ENDPOINT) {
die(drupal_not_found());
}
?>This is totally sloppy. You either conditionally define the menu handler or you should us an access callback to check if the endpoint is enabled. In either case you shouldn't show the user a link that they can't click on.

#1
The same principal goes for the admin interface for creating a sparql query node -- it includes a text box to enter the endpoint even if the endpoint functionality is disabled in the admin interface. Very confusing!