-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Joomla 4: $db->loadObjectList('id', MenuItem::class) fails on Unknown fetch type '8' #35452
Comments
Bug is located in |
@mahagr Which constant do you mean? And I think the issue should be reported here: https://github.com/joomla-framework/database as it's in the database driver. Or am I wrong? |
|
Please do not close this issue until you have updated the framework in CMS as it's a B/C break in Joomla. |
Thanks. Yes, we'll leave it open as reminder. |
@richard67 See the response in the Joomla Framework issue. |
@mahagr Yes, I saw. Here the link for reference for other readers: joomla-framework/database#254 (comment) . I'm not sure now what to do with this issue here. |
Do we have the same version of Framework in Joomla 3.10? I think the best way to deal with the issue is to have a better error message instead of the one from above. It is a compatibility issue for sure; older versions of Joomla accepted custom classes with all DB engines. Luckily it is something that is generally very easy to fix, but in my case, I totally missed it as I'm using PDO for testing. Also, should Joomla! 4 use PDO by default? |
3.10 and 4 use different versions of the Framework. Why PDO hasn't been chosen as default for new installations I don't know. |
@mbabker Any idea why Joomla 4 doesn't use PDO by default? |
Base on the discussion I read from the framework repo joomla-framework/database#254 (comment) , there would be no change to support the issue mentioned here. Anyone has this issue, please use the provided workaround: $list = [];
foreach ($db->loadAssocList('id') as $id => $data) {
$list[$id] = new MenuItem($data);
} With that said, I'm closing this issue here. |
Steps to reproduce the issue
Expected result
The query should work just as it worked in Joomla 3.9/3.10.
Actual result
Exception:
Unknown fetch type '8'
. This seems to happen when usingmysqli
but not when usingdbo
.System information (as much as possible)
PHP 8.0.10 / 7.4.23
Additional comments
Following workaround works (replace the last line):
The text was updated successfully, but these errors were encountered: