?
avatar rudisten1
rudisten1
23 Jul 2016

Steps to reproduce the issue

install joomla using a SQL Server db as the main database
go to "components - banners" in the administration site

Expected result

banners management console

Actual result

php notice error as follow:

Notice: Undefined offset: 1 in C:\inetpub\wwwroot\joomla7sqlsrv\libraries\joomla\database\query\sqlsrv.php on line 382

System information (as much as possible)

php 7
sqlsrv extension 4.0 non thread safe
IIS 7
joomla 3.6
SQL Server 2014

Additional comments

avatar rudisten1 rudisten1 - open - 23 Jul 2016
avatar rudisten1 rudisten1 - change - 23 Jul 2016
Title
Notice: Undefined offset: 1 in C:\inetpub\wwwroot\joomla7sqlsrv\libraries\joomla\database\query\sqlsrv.php
Notice: Undefined offset: 1 in \libraries\joomla\database\query\sqlsrv.php
avatar williamsandy
williamsandy - comment - 25 Jul 2016

This is because the group function in the JDatabaseQuerySqlsrv class always assumes two things:

  1. You always alias every table in your query
  2. You always use the keyword 'AS' when you are doing a table alias.

In fact you don't necessary have to use the 'AS' keyword when defining alias [although this is good practice] so this can lead to problems with the JDatabaseQuerySqlsrv group function which always assumes you do!

If you are doing a group by on a single table you are not necessarily going to use a table alias and that is what the getCategoryOrders function does in the banners component, leading to the PHP notice you are seeing in this issue.

avatar rudisten1
rudisten1 - comment - 25 Jul 2016

Ok, but this is not my custom component. It's the default banner component. Should we expect this to be fixed?


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

avatar pocketpc
pocketpc - comment - 25 Jul 2016

I have the same issue, you can mitigate by setting System>Global Configuration>Server>Error Reporting to None.

As for fixing, I might be able to get a pull request assembled at some point, but it's just a notice, so it's not particularly high priority.

avatar brianteeman
brianteeman - comment - 5 Sep 2016

Closed as we have a PR for testing #11938

avatar brianteeman brianteeman - change - 5 Sep 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-09-05 14:43:39
Closed_By brianteeman
avatar brianteeman brianteeman - close - 5 Sep 2016

Add a Comment

Login with GitHub to post a comment