-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[3.7.4] Falang database driver can't handle ->select('1') #17003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…t('COUNT(*)') instead
|
I've notified Falang about this issue. |
|
Using That is something which Falang should fix as the core code is perfectly fine. |
|
Using |
|
I still think it's a bug in Falang which they need to fix. |
|
I agree. Just saying, we won't be able to upgrade until either Falang or Joomla has changed. Or we make our own fork. |
|
@olleharstedt can you please close this Issue if its not a Core Issue? |
|
The following piece of code works differently in PHP 7 and PHP 5: $mysqli = mysqli_connect("localhost", "root", "", "mydatabase");
$res = mysqli_query($mysqli, "select 1");
$row = mysqli_fetch_object($res);
var_dump($row);In PHP 7 it will dump but in PHP 5 Therefore I think the PR is motivated. Maybe it can be changed to |
|
To complete this case. Joomla don't see the problem because the loadResult work fine with select('1) but the loadObject don't work fine. There are 2 file to change and replace for the check method libraries/joomla/table/nested.php line 694 libraries/joomla/table/nested.php line 997 |
|
did'nt experienced php 5 vs php 7 different behaviour ..despite i think should be fixed on falang side... |
|
With mysqli_fetch_row it's work but in Joomla if you change in the assets.php check method if ($this->_db->setQuery($query, 0, 1)->loadResult()) Falang use loadobject for all it's why there are a problem since the last Joomla version. the change of the query fix the problem on falang , it's not a Joomla bug because Joomla use loadResult. Stéphane |
|
NB: |
|
even if there are no performance issues, using |
|
Select (id) will work and it's a workaround for MySQL bug. no performance problem. |
|
there is no MySQL bug nor Joomla bug |
|
look at the @olleharstedt message and try this $mysqli = mysqli_connect("localhost", "root", "", "mydatabase"); The result is not the same with an empty object for php 5 |
|
maybe this can help https://bugs.php.net/bug.php?id=72151 |
This is needed for some third-party applications due to the different behaviour in PHP versions for mysqli_fetch_object.
|
The change proposed by olleharstedt don't affect performance and fix the prolem on Falang with php 5. |
|
I am closing this as not a Joomla core issue. |
Summary of Changes
As title.
Testing Instructions
Expected result
Actual result
Documentation Changes Required