? ? Pending

User tests: Successful: Unsuccessful:

avatar HLeithner
HLeithner
29 May 2019

Summary of Changes

Updated SQL queries to prepared statements and made some cleanups around the queries.

Testing Instructions

Use the plugin in all ways you can think of.

  • Activate the page navigation feature
  • create multiple articles in the same category
  • check the frontend if you can navigate to the next article
  • set the ordering in the menu and the global options, try different dates (create,published, modified)

Expected result

Nothing changed.

bb98617 7 May 2019 avatar HLeithner cs
avatar HLeithner HLeithner - open - 29 May 2019
avatar HLeithner HLeithner - change - 29 May 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2019
Category Front End Plugins
avatar franz-wohlkoenig franz-wohlkoenig - change - 30 May 2019
Title
Add prepared statements for plg_content_pagenavigation
[4.0] Add prepared statements for plg_content_pagenavigation
avatar franz-wohlkoenig franz-wohlkoenig - edited - 30 May 2019
avatar HLeithner HLeithner - change - 30 May 2019
Labels Added: ?
2cac072 31 May 2019 avatar HLeithner cs
avatar SharkyKZ
SharkyKZ - comment - 9 Jul 2019

Currently (with or without patch) the plugin doesn't return any articles due to invalid workflow query. Do you want to add a fix in here? Or should we wait until this is merged first?

avatar HLeithner
HLeithner - comment - 9 Jul 2019

@SharkyKZ Can you point me to the workflow query problem?

avatar SharkyKZ
SharkyKZ - comment - 9 Jul 2019

Here are related PRs #24785, #24494.

avatar HLeithner
HLeithner - comment - 10 Jul 2019

I it's not a problem of the PR I would merge it WF needs a major update anyway.

avatar SharkyKZ
SharkyKZ - comment - 15 Jul 2019

Fix conflict please.

avatar Quy
Quy - comment - 9 Aug 2019
PHP Notice:  Undefined index: :publishup in \libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php on line 412
PHP Notice:  Undefined index: :publishup in \libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php on line 413
PHP Warning:  mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in \libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php on line 430

To reproduce:

  • install Testing Sample Data
  • on front end, click Article Category List
  • click Beginners
avatar HLeithner
HLeithner - comment - 9 Aug 2019
PHP Notice:  Undefined index: :publishup in \libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php on line 412
PHP Notice:  Undefined index: :publishup in \libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php on line 413
PHP Warning:  mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in \libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php on line 430

To reproduce:

  • install Testing Sample Data
  • on front end, click Article Category List
  • click Beginners

can you post a stack trace ?

avatar Quy
Quy - comment - 9 Aug 2019

1 | () | JROOT\libraries\vendor\joomla\database\src\Mysqli\MysqliStatement.php:432
-- | -- | --
2 | Joomla\Database\Mysqli\MysqliStatement->execute() | JROOT\libraries\vendor\joomla\database\src\DatabaseDriver.php:673
3 | Joomla\Database\DatabaseDriver->execute() | JROOT\libraries\vendor\joomla\database\src\DatabaseDriver.php:1336
4 | Joomla\Database\DatabaseDriver->loadObjectList() | JROOT\plugins\content\pagenavigation\pagenavigation.php:208
5 | PlgContentPagenavigation->onContentBeforeDisplay() | JROOT\libraries\src\Plugin\CMSPlugin.php:285
6 | Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() | JROOT\libraries\vendor\joomla\event\src\Dispatcher.php:495
7 | Joomla\Event\Dispatcher->dispatch() | JROOT\libraries\src\Application\EventAware.php:111
8 | Joomla\CMS\Application\WebApplication->triggerEvent() | JROOT\components\com_content\View\Article\HtmlView.php:249
9 | Joomla\Component\Content\Site\View\Article\HtmlView->display() | JROOT\libraries\src\MVC\Controller\BaseController.php:690
10 | Joomla\CMS\MVC\Controller\BaseController->display() | JROOT\components\com_content\Controller\DisplayController.php:127
11 | Joomla\Component\Content\Site\Controller\DisplayController->display() | JROOT\libraries\src\MVC\Controller\BaseController.php:728
12 | Joomla\CMS\MVC\Controller\BaseController->execute() | JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:146
13 | Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() | JROOT\components\com_content\Dispatcher\Dispatcher.php:55
14 | Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch() | JROOT\libraries\src\Component\ComponentHelper.php:383
15 | Joomla\CMS\Component\ComponentHelper::renderComponent() | JROOT\libraries\src\Application\SiteApplication.php:205
16 | Joomla\CMS\Application\SiteApplication->dispatch() | JROOT\libraries\src\Application\SiteApplication.php:244
17 | Joomla\CMS\Application\SiteApplication->doExecute() | JROOT\libraries\src\Application\CMSApplication.php:241
18 | Joomla\CMS\Application\CMSApplication->execute() | JROOT\includes\app.php:63
19 | require_once() | JROOT\index.php:36
avatar HLeithner
HLeithner - comment - 9 Aug 2019

Thx, while checking the code I don't find a reason for this. I have to investigate further...

avatar Quy
Quy - comment - 9 Aug 2019

No prepared statement to bind to?

$query->bind(':publishup', $nullDate);

669bb75 26 Aug 2019 avatar HLeithner cs
avatar SharkyKZ SharkyKZ - test_item - 18 Sep 2019 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 18 Sep 2019

I have tested this item successfully on 62ff557

Doesn't work, just like before.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25051.

avatar Quy
Quy - comment - 18 Sep 2019

@SharkyKZ Your comment contradicts your successful test. Should it be marked unsuccessful?

avatar SharkyKZ
SharkyKZ - comment - 19 Sep 2019

It's fine. Just that existing issue (#25051 (comment)) hasn't been fixed in this PR.

avatar wilsonge
wilsonge - comment - 9 Oct 2019

Conflicts please

avatar HLeithner
HLeithner - comment - 18 Oct 2019

@wilsonge conflicts solved.

avatar JazParkyn JazParkyn - test_item - 19 Oct 2019 - Tested unsuccessfully
avatar JazParkyn
JazParkyn - comment - 19 Oct 2019

I have tested this item ? unsuccessfully on fa63af1

Patch contains SQL error:

 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IS NULL OR `publish_down` >= ?) ORDER BY `a`.`ordering`' at line 5 
Call stack
# 	Function 	Location
1 	() 	JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:149
2 	Joomla\Database\Mysqli\MysqliStatement->__construct() 	JROOT/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1032
3 	Joomla\Database\Mysqli\MysqliDriver->prepareStatement() 	JROOT/libraries/vendor/joomla/database/src/DatabaseDriver.php:1862
4 	Joomla\Database\DatabaseDriver->setQuery() 	JROOT/plugins/content/pagenavigation/pagenavigation.php:203
5 	PlgContentPagenavigation->onContentBeforeDisplay() 	JROOT/libraries/src/Plugin/CMSPlugin.php:285
6 	Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() 	JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:495
7 	Joomla\Event\Dispatcher->dispatch() 	JROOT/libraries/src/Application/EventAware.php:111
8 	Joomla\CMS\Application\WebApplication->triggerEvent() 	JROOT/components/com_content/View/Article/HtmlView.php:249
9 	Joomla\Component\Content\Site\View\Article\HtmlView->display() 	JROOT/libraries/src/MVC/Controller/BaseController.php:690
10 	Joomla\CMS\MVC\Controller\BaseController->display() 	JROOT/components/com_content/Controller/DisplayController.php:127
11 	Joomla\Component\Content\Site\Controller\DisplayController->display() 	JROOT/libraries/src/MVC/Controller/BaseController.php:728
12 	Joomla\CMS\MVC\Controller\BaseController->execute() 	JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:146
13 	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() 	JROOT/components/com_content/Dispatcher/Dispatcher.php:55
14 	Joomla\Component\Content\Site\Dispatcher\Dispatcher->dispatch() 	JROOT/libraries/src/Component/ComponentHelper.php:383
15 	Joomla\CMS\Component\ComponentHelper::renderComponent() 	JROOT/libraries/src/Application/SiteApplication.php:205
16 	Joomla\CMS\Application\SiteApplication->dispatch() 	JROOT/libraries/src/Application/SiteApplication.php:244
17 	Joomla\CMS\Application\SiteApplication->doExecute() 	JROOT/libraries/src/Application/CMSApplication.php:241
18 	Joomla\CMS\Application\CMSApplication->execute() 	JROOT/includes/app.php:63
19 	require_once() 	JROOT/index.php:36 <hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/25051">issues.joomla.org/tracker/joomla-cms/25051</a>.</sub>
avatar HLeithner
HLeithner - comment - 19 Oct 2019

thx @JazParkyn is fixed now thx to @Quy

avatar waader waader - test_item - 20 Oct 2019 - Tested unsuccessfully
avatar waader
waader - comment - 20 Oct 2019

I have tested this item ? unsuccessfully on ada289b

"Category List" works, "Category Blog" doesn´t. This problem exists also without this patch.

I tested with postgresql.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25051.

avatar Quy
Quy - comment - 23 Jan 2020

Please fix conflicts.

avatar wilsonge
wilsonge - comment - 25 Jan 2020

OK let's get some tests here - this is the last PR in the prepared statements project - would be nice to get that finally shut down

avatar Quy
Quy - comment - 25 Jan 2020

See #27587 which prevents testing.

avatar wilsonge
wilsonge - comment - 26 Jan 2020

That issue is unrelated to this plugin I’ve clarified there

avatar Quy
Quy - comment - 9 Feb 2020

Please fix conflicts.

avatar wilsonge wilsonge - change - 10 Feb 2020
Labels Added: Conflicting Files
avatar wilsonge
wilsonge - comment - 10 Feb 2020

Should be fixed

avatar wilsonge
wilsonge - comment - 17 Mar 2020

@HLeithner can you spend some time fixing the issue raised here please

avatar wilsonge
wilsonge - comment - 27 Mar 2020

@HLeithner bump again

avatar HLeithner HLeithner - change - 27 Mar 2020
Labels Added: ?
Removed: Conflicting Files
avatar HLeithner HLeithner - change - 27 Mar 2020
Labels Added: ?
Removed: ?
avatar HLeithner
HLeithner - comment - 27 Mar 2020

Should work again now...

avatar alikon
alikon - comment - 27 Mar 2020

I have tested this item successfully on c8f3afc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25051.

avatar alikon alikon - test_item - 27 Mar 2020 - Tested successfully
avatar Quy
Quy - comment - 27 Mar 2020

I have tested this item successfully on c8f3afc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25051.

avatar Quy Quy - change - 27 Mar 2020
Status Pending Ready to Commit
avatar Quy Quy - test_item - 27 Mar 2020 - Tested successfully
avatar Quy
Quy - comment - 27 Mar 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25051.

avatar wilsonge wilsonge - change - 27 Mar 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-03-27 20:56:22
Closed_By wilsonge
Labels Added: ?
Removed: ?
avatar wilsonge
wilsonge - comment - 27 Mar 2020

Thanks!

Add a Comment

Login with GitHub to post a comment