joomla-extensions / weblinks

This repo is meant to hold the decoupled com_weblinks component and related code.
GNU General Public License v2.0
45 stars 88 forks source link

Weblinks com_search plugin causes Search error on Joomla! 4.4.0 #544

Closed Basket-weaver closed 10 months ago

Basket-weaver commented 10 months ago

Steps to reproduce the issue

Install Weblinks 4.3.1 on Joomla! 4.4.0. Install or update to Search (i.e. com_search) version 4.1.0

Enable all the com_search plugins (content, categories, web links,..). Create a front end menu item which is a Search (i.e. com_search), not Smart Search. Select 'Search' menu item (e.g. URL will be similar to https://www.mirrorsailing.org.uk/index.php?option=com_search&view=search&Itemid=786)

Expected result

The Search page/form opens and you can specify the string you want to search for and select the type of item(s) you want searched (articles, weblinks, categories,...)

Actual result

The requested page can't be found.

An error has occurred while processing your request.

You may not be able to visit this page because of:

an out-of-date bookmark/favourite
a mistyped address
a search engine that has an out-of-date listing for this site
you have no access to this page

Go to the Home Page

If difficulties persist, please contact the website administrator and report the error below.

0 Call to a member function get() on null 

Call stack

Function Location

1 () JROOT/plugins/search/weblinks/src/Extension/Weblinks.php:106 2 Joomla\Plugin\Search\Weblinks\Extension\Weblinks->onContentSearch() JROOT/libraries/src/Plugin/CMSPlugin.php:289 3 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486 4 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111 5 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/components/com_search/src/Model/SearchModel.php:150 6 Joomla\Component\Search\Site\Model\SearchModel->getData() JROOT/libraries/src/MVC/View/AbstractView.php:152 7 Joomla\CMS\MVC\View\AbstractView->get() JROOT/components/com_search/src/View/Search/HtmlView.php:228 8 Joomla\Component\Search\Site\View\Search\HtmlView->display() JROOT/libraries/src/MVC/Controller/BaseController.php:660 9 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/components/com_search/src/Controller/DisplayController.php:40 10 Joomla\Component\Search\Site\Controller\DisplayController->display() JROOT/libraries/src/MVC/Controller/BaseController.php:693 11 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:143 12 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361 13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208 14 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249 15 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293 16 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61 17 require_once() JROOT/index.php:32

System information (as much as possible)

Weblinks 4.3.1 on Joomla! 4.4.0, site has been migrated from Joomla! 3.10.x , Search (i.e. com_search) version 4.1.0, PHP 8.1.25

Additional comments

If I disable the 'Search - Web Links' plugin, and then go to the front end and try the Search menu item, I get the search form and I can search (articles, categories,...).

This is a large site (over 2,000 articles) and so far, I've not managed to get Smart Seach to index it (https://docs.joomla.org/Smart_Search_on_large_sites), hence using old style com_search to give at least some search capability.

joomdonation commented 10 months ago

Hello

There was a small typo in the search plugin and it causes this error. Could you please install this updated weblinks search plugin, then check to see if it solves the issue

plg_search_weblinks.zip

joomdonation commented 10 months ago

@Basket-weaver Please check the attached plugin in my previous comment to see if it solves your issue ?

Basket-weaver commented 10 months ago

Hi Tuan,

OK, I've installed your updated weblinks search plugin, and it no longer throws an error, see https://www.mirrorsailing.org.uk/index.php?option=com_search&view=search&Itemid=786 , thank you.

I've got quite a few weblinks (almost 400), for example https://www.mirrorsailing.org.uk/index.php?option=com_weblinks&view=category&id=633&Itemid=110 , so there is one called Hawk Marine Products.

but if I search for a Web Link containing the string 'Hawk', I get no hits. Should I report this as another error?

Regards Martin Egan

----- Original Message ----- From: Tuan Pham Ngoc To: joomla-extensions/weblinks Cc: Basket-weaver ; Author Sent: Tuesday, November 14, 2023 12:48 PM Subject: Re: [joomla-extensions/weblinks] Weblinks com_search plugin causes Search error on Joomla! 4.4.0 (Issue #544)

Hello

There was a small typo in the search plugin and it causes this error. Could you please install this updated weblinks search plugin, then check to see if it solves the issue

plg_search_weblinks.zip

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

joomdonation commented 10 months ago

Hi @Basket-weaver

I'm really sorry for lately response. I missed your reply. Back to your issues :

  1. Please try to install this latest package of weblinks
  2. Then find Search - Web Links plugin, click on it to edit, make sure Search Published parameter set to Yes (it's No by default). You might also want to set Search Archived parameter to Yes, too, to make archived web links searchable

Then check it again. It should work well

Regards,

Tuan pkg-weblinks-4.3.1.zip

Basket-weaver commented 10 months ago

Hi Tuan,

installed latest package of weblinks, configured Search - Web Links as you suggested, it works correctly, so thank you for your help.

My closing comment would be the I think having the 'Search Published' parameter set to 'No' by default is an odd choice.

joomdonation commented 10 months ago

My closing comment would be the I think having the 'Search Published' parameter set to 'No' by default is an odd choice.

I agree. That's the reason I made change on this commit https://github.com/joomla-extensions/weblinks/commit/52ecfad0ebc79730014d1bea009d0b1fd71a7709 (Strange that it's No for all other Joomla search plugins). I would also change Search Archived to No, but since it's default value in the code is Yes, I have it set to Yes for now)

joomdonation commented 10 months ago

As the issue was sorted, I'm closing.