How to Remove Dead Search Link in Tools Menu?

I add a link in the Tools Menu for the search form created using this plugin.  Without removing this Tools Menu link for the search form, I did a combination of removing the form that the search form points to and disable the form and flexprofile a couple times.  Now there is a dead link in the Tool Menu.  When I click on it, it says "
Fatal error: Call to a member function getOwner() on a non-object in /home/my/public_html/mod/form/start.php on line 75"

How do I remove this dead Tools Menu link? 

Thanks.

 

  • Thank you for this bug report.

    The problem was caused by the fact that form search definitions are not deleted when the corresponding form is deleted.

    I have fixed this in my version of the code and will include the fix in the next release.

    You can fix your problem by editing the form_set_menu_items() function in mod/form/models/model.php

    Change the section following // add search links to:

    // add search links
        $entities = get_entities_from_metadata('creates_menu',1,'object','form:search_definition');
        if ($entities) {
            foreach($entities as $sd) {
                $form = get_entity($sd->form_id);
                if ($form) {
                    add_menu(form_search_definition_t($form,$sd,'menu'),$CONFIG->wwwroot.'mod/form/search.php?sid='.$sd->getGUID());
                }
            }
        }

    (That is, add the if($form) bit.)

  • Is there a way to delete the link and search definition in Tools Menu manually?  I just need to remove the orphan link and orphan search definition now, and I can wait for the next version for the code change since I won't delete the form in near future.  Does this fix delete the search definition when the form is deleted?  It seems that it deals only with adding the search links, not deleting the form.

  • What I posted fixes your immediate problem.

    At this point I'm not sure when the next code release will be coming out so I suggest that you do not wait for that.

  • Your fix works.  Hope that you will have new release soon.  Thanks.

Form and related plugins

Form and related plugins

User-generated content, flexible user and group profiles, registration forms, custom file forms