PontusHorn / Pico-Search

Simple search feature for pages in your Pico CMS
MIT License
22 stars 4 forks source link

Error: Undefined index: q at /var/www/nextcloud/apps/cms_pico/appdata_public/plugins/CaAM97BhYU/PicoSearch/PicoSearch.php#31 #11

Closed muranava closed 3 years ago

muranava commented 3 years ago

Hi not sure if i should notify here or over at cmspico I'll try here first, search works but i get this trace:

{"reqId":"YE4EDIKdXH1YlKywlDtQNAAAAEU","level":3,"time":"2021-03-14T12:39:40+00:00","remoteAddr":"xxxxxxxxx","user":"xxx","app":"PHP","method":"GET","url":"/index.php/apps/cms_pico/pico_proxy/eltresearchbites_archive/search","message":{"Exception":"Error","Message":"Undefined index: q at /var/www/nextcloud/apps/cms_pico/appdata_public/plugins/CaAM97BhYU/PicoSearch/PicoSearch.php#31","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/cms_pico/appdata_public/plugins/CaAM97BhYU/PicoSearch/PicoSearch.php","line":31,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/apps/cms_pico/vendor/picocms/pico/lib/AbstractPicoPlugin.php","line":101,"function":"onRequestUrl","class":"PicoSearch","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/appdata_public/plugins/CaAM97BhYU/PicoDeprecated/PicoDeprecated.php","line":319,"function":"handleEvent","class":"AbstractPicoPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/appdata/plugins/PicoDeprecated/lib/AbstractPicoPluginApiCompatPlugin.php","line":81,"function":"triggerEvent","class":"PicoDeprecated","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/appdata/plugins/PicoDeprecated/lib/AbstractPicoPluginApiCompatPlugin.php","line":49,"function":"triggerEvent","class":"AbstractPicoPluginApiCompatPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/appdata/plugins/PicoDeprecated/lib/AbstractPicoPluginApiCompatPlugin.php","line":76,"function":"handleEvent","class":"AbstractPicoPluginApiCompatPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/appdata/plugins/PicoDeprecated/lib/AbstractPicoPluginApiCompatPlugin.php","line":49,"function":"triggerEvent","class":"AbstractPicoPluginApiCompatPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/appdata_public/plugins/CaAM97BhYU/PicoDeprecated/PicoDeprecated.php","line":134,"function":"handleEvent","class":"AbstractPicoPluginApiCompatPlugin","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/vendor/picocms/pico/lib/Pico.php","line":2788,"function":"handleEvent","class":"PicoDeprecated","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/vendor/picocms/pico/lib/Pico.php","line":449,"function":"triggerEvent","class":"Pico","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Pico.php","line":108,"function":"run","class":"Pico","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Service/PicoService.php","line":149,"function":"run","class":"OCA\\CMSPico\\Pico","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Service/WebsitesService.php","line":279,"function":"getPage","class":"OCA\\CMSPico\\Service\\PicoService","type":"->"},{"file":"/var/www/nextcloud/apps/cms_pico/lib/Controller/PicoController.php","line":110,"function":"getPage","class":"OCA\\CMSPico\\Service\\WebsitesService","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"getPage","class":"OCA\\CMSPico\\Controller\\PicoController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Linux; Android 7.1.2; xxx) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 Mobile Safari/537.36","version":"20.0.8.1","id":"604e06317e57e"}

muranava commented 3 years ago

to follow up on this after a google search i added isset so that it is
isset($_GET['q'])) on line 31 and it seems to have stopped the error message

PontusHorn commented 3 years ago

Thanks for reporting and fixing! I merged your PR (#12).