Would it be possible to have a global setting for "also considered local" for pathologic, and then each text format can override that if necessary? This would save having to enter the paths for each text format, when in most cases they would be the same.

Comments

Garrett Albright’s picture

Assigned: Unassigned » Garrett Albright

It would be possible. That's not a terrible idea, actually, though I'm not quite sure how to properly implement it - would probably need some experimentation. Might not be able to get to it any time soon, though.

alan d.’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new19.81 KB
new15.23 KB
new4.85 KB

Agree, it is painful trying to keep the base URLs up to date if you have a lot of these.

A quick and simple way would be to define a default callback that defines the settings in code, which if available, disables the Filter vertical tab settings with a message.

Rough and ready patch to demo the idea, albeit lacking any real tlc

Without any modules defining this new hook

And with a module defining the hook

/**
 * Implements hook_pathologic_settings().
 */
function xxxxxxx_pathologic_settings($defaults) {
  return array(
    'protocol_style' => 'path',
    'local_paths' => "http://example.com\nhttp://example.org",
  ) + $defaults;
}

Flagging needs review, just in case automated testing is enabled, but not really ready. If 2 modules define this hook, the callback will fail and the defaults would be used. Maybe a variable_get('pathologic_settings_override') with a function_exists() would be better?

Status: Needs review » Needs work

The last submitted patch, 2: pathologic-1285848-2-global-settings-callback.patch, failed testing.

Garrett Albright’s picture

defines the settings in code

A Feature wouldn't do the job here?

alan d.’s picture

Feature?

Well that would be better :)

Garrett Albright’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev

I've decided that the yet-to-be-started 8.x-2.x branch will use global settings. It really doesn't make sense for Pathologic to be configured differently on a per-input-format basis, and I realy should have realized that a long, long time ago.

I haven't yet decided if I will backport this idea to previous branches.

Garrett Albright’s picture

Version: 8.x-1.x-dev » 7.x-3.x-dev