In our Panopoly distribution we have fieldable_panels_panes.module installed along with redirect.module. If we add a fieldable panels pane to a page, save pane and then click on the gear icon again we see URL Redirects settings appear in the configuration overlay:
It doesn't make any sense to define a redirect to a panel pane. We can't think of any situation where you'd want to create a redirect to the URI of a FPP. (I'm sure you will let me know if there is a scenario in which you'd want to do this.)
The redirect module tests for "redirect support" as follows:
function redirect_entity_type_supports_redirects($entity_type) {
$types = &drupal_static(__FUNCTION__);
if (!isset($types)) {
$types = array();
foreach (entity_get_info() as $type => $entity_info) {
$types[$type] = !empty($entity_info['uri callback']) && (!isset($entity_info['redirect']) || !empty($entity_info['redirect']));
}
}
return isset($types[$entity_type]) ? $types[$entity_type] : FALSE;
}
In order to prevent the redirect configuration from appearing, I'm proposing the following patch.
Comments
Comment #1
bwood commentedComment #2
bwood commentedComment #3
cboyden commentedThe patch looks good - a nice and simple fix. It's working in my testing. In order for the change to take effect, I had to clear cache (just the class registry cache). Unless this is something that needs an update hook, it should be good to go.
Comment #4
bwood commentedNo update hook should be necessary.
Thanks for testing @cboyden!
Comment #5
damienmckennaI'd prefer it if the 'redirect' attribute was set to FALSE.
Comment #6
cboyden commentedOK, I changed it to set the attribute to FALSE. Updated patch and interdiff attached.
Comment #7
damienmckennaCommitted. Thank you both!