? ? Failure

User tests: Successful: Unsuccessful:

avatar csthomas
csthomas
19 Feb 2016

Column category path_published is a calculation of all parents and own category published.

I have experience with big joomla 3 website and a lots of time I try to improve performance.
This is one of that.

You can see performance improvement on featured or category view especially.
All calculation of category state is calculated when administrator change state of category.
Front end sql check only one column - c.path_published.

Examples of category paths (after calculation):

  • Root(published=1, path_published=1)->Category1(published=1, path_published=1)
    (... - represent about line)
  • ... Category2(published=-2, path_published=-2)->Category3(published=1, path_published=-2)
  • ... Category2(published=2, path_published=2)->Category3(published=1, path_published=2)
  • ... Category2(published=0, path_published=0)->Category3(published=1, path_published=0)
  • ... Category2(published=2, path_published=2)->Category3(published=0, path_published=0)
  • ... Category2(published=2, path_published=2)->Category3(published=1, path_published=2)

Priority for calculation state for path_published in table #__categories:

  • the most priority has Trash if published (-2), then all children will have path_published -2
  • the next is Unpublished if published (0), then all children may have path_published -2 or 0
  • the next is Archive if published (2), then all children may have path_published -2,0 or 2
  • the last one is Published (1)

Please comment.

avatar csthomas csthomas - open - 19 Feb 2016
avatar csthomas csthomas - change - 19 Feb 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Feb 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 19 Feb 2016
Category SQL
avatar csthomas
csthomas - comment - 1 Mar 2016

In short: it moves computing of publish state on category tree from view to administrator what should be more reasonable.

This is valuable patch, but complicated.
If someone have problem with slow featured view on home page or on big category view this patch can help.

Subquery with badcats eats more memory when getting a lots of articles.
I talk about #__content table with more than 100K articles where lots of are featured.

I had problems with a lots of queries from articles.php model that fails because of mysql memory problems and returns NULL
then I wrote that patch and one another at

#9161

I used that patches in joomla 2.5 and I use in joomla 3.4 on production server (mysql only) and have not got any problems.

Can I ask someone to point me where is a problem with tests?
I changed installation sql for mysql/postresql/sqlazure.

Where should I change code to pass tests?


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

avatar brianteeman
brianteeman - comment - 1 Mar 2016

Tests are not something I can help you with but the CI reports the issue as

There was 1 error:
1) JComponentRouterViewTest::testGetPath
PDOException: SQLSTATE[HY000]: General error: 1 no such column: c.path_published
/home/travis/build/joomla/joomla-cms/libraries/joomla/database/driver/pdo.php:723
/home/travis/build/joomla/joomla-cms/libraries/legacy/categories/categories.php:302
/home/travis/build/joomla/joomla-cms/libraries/legacy/categories/categories.php:184
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/cms/component/router/stubs/JComponentRouterViewInspector.php:59
/home/travis/build/joomla/joomla-cms/libraries/cms/component/router/view.php:116
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/cms/component/router/JComponentRouterViewTest.php:139


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

avatar csthomas
csthomas - comment - 5 Mar 2016

The CI reports:
PDOException: SQLSTATE[HY000]: General error: 1 no such column: c.path_published

but I added a new column in:

  • installation/sql/mysql/joomla.sql
  • installation/sql/postgresql/joomla.sql
  • installation/sql/sqlazure/joomla.sql

Where should I add it too?

avatar joomla-cms-bot joomla-cms-bot - change - 7 Mar 2016
Labels Added: ?
avatar csthomas
csthomas - comment - 7 Mar 2016

Thanks @mbabker

  • I added changes to ddl.sql and postresql.sql.
  • mysql.sql does not contain any table structures so I did not change it.
  • sqlsrv.sql is probably very old and had EOL problem, MAC version? I converted it to "\n" linux version and I added my changes.

Now I can not understand what is the problem with the tests.

avatar csthomas
csthomas - comment - 8 Mar 2016

I have found that my pull request is not very useful for joomla 3 after was added "publish cascade".

avatar brianteeman
brianteeman - comment - 8 Mar 2016

Should I close it then?

avatar csthomas
csthomas - comment - 9 Mar 2016

I close it.

avatar csthomas csthomas - change - 9 Mar 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-03-09 09:12:22
Closed_By csthomas

Add a Comment

Login with GitHub to post a comment