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: fpp redirect settings screenshot 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

bwood’s picture

bwood’s picture

Status: Active » Needs review
cboyden’s picture

Status: Needs review » Reviewed & tested by the community

The 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.

bwood’s picture

No update hook should be necessary.

Thanks for testing @cboyden!

damienmckenna’s picture

Title: Fieldable panel panes should specify redirect support in hook_entity_info() » Fieldable Panel Panes should disable support for the Redirect module
Parent issue: » #2493105: [meta] Plan for Fieldable Panels Pane 7.x-1.8 release

I'd prefer it if the 'redirect' attribute was set to FALSE.

cboyden’s picture

Assigned: bwood » Unassigned
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new454 bytes
new411 bytes

OK, I changed it to set the attribute to FALSE. Updated patch and interdiff attached.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thank you both!

  • DamienMcKenna committed a23f803 on 7.x-1.x authored by bwood
    Issue #2534200 by bwood, cboyden: Disable support for the Redirect...

Status: Fixed » Closed (fixed)

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