This patch does various things:
(i) there was the odd URL flexinode/search, IMO flexinode search should be part of the main search. this patch does that.
(ii) search simply failed because ctype_id was never passed to the search function. Fixed in this patch.
(iii) it only used MENU_CALLBACK, and it was undocumented. I chose to enable it by default.
(iiii) there was no interface to find what flexniode-types you could search for, this patch adds subtabs for each flexinode type.

Comments

Bèr Kessels’s picture

StatusFileSize
new24.61 KB

here is a screenshot of how my changes appear. You can try them at http://staging.spelplezier.net/search/flexinode

Bèr Kessels’s picture

StatusFileSize
new6.79 KB

More improvements made.

This patch makes flexinode return actual searhc result and even passes that trough the search result themes and context-generators.

Please give it a try! I will only commit this aafter I get some feedback on this!

fago’s picture

Status: Needs review » Needs work

i've tested it.
on search/flexinode i get a notfound error (as there is no ctype_id to search for)
however it seems to work at your site?

then, what if there is only one content type?
then there will be no lokal task menu, so the user doesn't know whats different with the advanced tab

i like the idea, so +1 for it.

but imho the patch needs a little further work.
what about showing a short headline, if there is only one content type?

fago’s picture

ah, i forgot to mention that in the search results, the node id is missing in the urls

bwynants’s picture

same 'Page not found' when clicking on advanced. this is because search/flexinode has no id attached and the code triggers this as drupal_not_found

after clicking 'advanced' you have to click one of the labels...

function flexinode_page_search_form($ctype_id = 0) {
  if (!$ctype_id && !$ctype_id = arg(2)) {
    drupal_not_found();
  }

as for missing node: change in flexinode_search_results

      $entry = array('link' => url('node/'. $item), 

into

      $entry = array('link' => url('node/'. $res->nid), 

appart rom that, great patch!

scroogie’s picture

The idea is great, i would like to see it contributed!

bwynants’s picture

Following changes work around the page not found...

  if ($may_cache) {
    $type = MENU_DEFAULT_LOCAL_TASK;
    foreach (flexinode_content_types() as $ctype) {
      $items[] = array('path' => 'node/add/flexinode-'. $ctype->ctype_id, 'title' => t($ctype->name),
        'access' => user_access('create '. $ctype->name .' content'));
      $items[] = $items[] = array('path' => 'search/flexinode/'. $ctype->ctype_id, 'title' => t($ctype->name),
        'callback' => 'flexinode_page_search_form',
        'access' => (user_access('access content') && user_access('search content')),
        'type' => $type);
      $type = MENU_LOCAL_TASK;
    }

and

function flexinode_page_search_form($ctype_id = 0) {
  if (!$ctype_id && !$ctype_id = arg(2)) {
	$ctype_id = current(flexinode_content_types())->ctype_id;
  }
Bèr Kessels’s picture

bwynants, please read drupal.org/diffandpatch. Sending in a patch makes it easier for all of us.

bwynants’s picture

Status: Needs work » Needs review
StatusFileSize
new7.26 KB

was working on that :-)

this is a patch file to be applied onto the 4.6.4 version from cvs

it fixed:
page not found and link not correct