Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Search Class Supports an Old API Mode which should be removed #1042

Closed eSilverStrike closed 2 years ago

eSilverStrike commented 4 years ago

The search class currently supports old API calls defined for versions prior to Geeklog 1.5.1. At some point we may want to remove this code as no plugin from that era would work with the current version of Geeklog.

To find the code search for 'api' in the 'search.class.php' file.

eSilverStrike commented 2 years ago

Notice this error on Geeklog.net (which is running the latest code for all plugins and Geeklog as of 2022-08-11

Thu Aug 11 03:52:00 2022 - 0.0.0.0 - E_WARNING(2) - Trying to access array offset on value of type bool @ /usr/home/geeklog/geeklog/plugins/faqman/functions.inc line 304

Seems like FAQMan Plugin does use old Search API. Not sure if old Geeklog Search API even worked and was returned in results.

So FAQMan either needs to be converted to use new Search API or this commit for this issue needs to be backed out. (I rather see FAQMan updated)

We should also confirm that all currently being updated plugins (in https://github.com/Geeklog-Plugins) support new search API (which I thought they did as new search api is many years old now)

Also looking at the old search code in FAQMan I see additional old API search code that should probably be removed. Like in the plugin.class.php has functions like addSearchHeading, addSearchResult and variables like num_searchresults. In fact all search stuff can go in it I think (the submission stuff is needed though...)

@mystralkk Do you have time to look into this? Not sure that I do as I am not really setup for developing where I am at the moment. I can do it in September probably but I was hoping to release Geeklog 2.2.2 at that time and the rest of the plugins.

mystralkk commented 2 years ago

I updated the Faqman plugin to use the new search API. For other plugins, I'll look into them later.

mystralkk commented 2 years ago

I have confirmed that all the plugins under https://github.com/Geeklog-Plugins that have implemented plugin_dopluginsearch_xxx API use the new API.