Hi,

I needed to add BUEditor into a wiki made with wikitools. This wiki has the path "wiki/", but the problem is edit form are located in "node/*/edit".

I wanted to discriminated wiki edit pages and I installed the module "subpath_alias". It works really fine, now I have the edit path in "wiki/pagename/edit", but BUEditor is detecting it as "node/*/edit".

I solved the problem adding a piece of code in "blueditor.module", at bueditor_check_page() function:

function bueditor_check_page($page, $eid) {
  $editor = is_numeric($eid) ? bueditor_editors($eid) : $eid;

  if ($editor) {
    if (drupal_match_path($page, $editor->pages)) {
      return $editor;
    }

	$alias = drupal_get_path_alias($page);
	
	if (module_exists('subpath_alias')) {
		$query_string = array();
		parse_str($_SERVER['QUERY_STRING'], $query_string);
		$alias = $query_string['q'];
	}

    if ($alias != $page && drupal_match_path($alias, $editor->pages)) {
      return $editor;
    }
    if (arg(0) == 'node' && arg(2) == 'edit') {
      $node = node_load(arg(1));
      if ($node && strpos($editor->pages, 'node/add/'.  $node->type) !== FALSE) {
        return $editor;
      }
    }
  }

  return FALSE;
}

Regards.

Comments

ufku’s picture

Did you try adding the path "node/add/YOUR_CONTENT_TYPE" to the visibility settings?

If you have, for example, node/add/story in the settings then the visibility check will pass for all node/x/edit pages of the story type.

sjovanig’s picture

Hi,

node/add/YOUR_CONTENT_TYPE is not the problem because in adding content URL content type appears. But if I want to identify content type at edit page (node/nid/edit) I have to use subpath_alias and the hack is needed...

sjovanig’s picture

Oh!

Sorry, I've seen the last lines do the type check... Issue closed...

Thanks!

ufku’s picture

Status: Active » Closed (fixed)