Sort array bug (SC)

Hello!

v5.8.2
w10
php

image

Results in:

 "code": 0,
 "file": "C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\modules\\arraylist.php",
 "line": 118,
 "message": "Cannot use object of type stdClass as array",
 "trace": "#0 [internal function]: modules\\arraylist->modules\\{closure}(Object(stdClass), Object(stdClass))\n#1 C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\modules\\arraylist.php(121): usort(Array, Object(Closure))\n#2 C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\lib\\App.php(204): modules\\arraylist->sort(Object(stdClass), '', NULL)\n#3 C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\lib\\App.php(176): lib\\App->execSteps(Object(stdClass))\n#4 C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\lib\\App.php(144): lib\\App->execSteps(Array)\n#5 C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\lib\\App.php(133): lib\\App->exec(Object(stdClass), false)\n#6 C:\\UwAmp\\www\\test_lh\\dmxConnectLib\\lib\\App.php(111): lib\\App->exec(Object(stdClass))\n#7 C:\\UwAmp\\www\\test_lh\\dmxConnect\\api\\wapplercommunity\\sortarraybug.php(173): lib\\App->define(Object(stdClass))\n#8 {main}"
 }

Hey @franse,

I’m getting errors also… Maybe @patrick should take a look at this (arrayslist.php).

Meanwhile, from what I see you are trying:

  • to pull the query’s data
  • insert them in an array list
  • sort the list
  • assign the sorted array list to a new array list…

What are you trying to do in fact?
Can’t sort the query straight ahead?

Hey!
Just an example to show that the sort array step doesn’t work, or maybe i’m missing something.

You’re right, that’s what I faced also.
The Create list step is causing error by itself. And I wonder how my Dynamic navigation bar is working, It’s built with Arrays list…
We’ll see about it.
I just asked what are you trying to do cause maybe there is another way to accompish it.

1 Like

Please test if the following update fixes the issue

arraylist.zip (825 Bytes) unzip to dmxConnectLib/modules.

Hey @patrick,

No…
The error I get was is different than france’s error (and remains the same after the new arraylist.php)

)

Please see below

{
"code": 0,
"file": "C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\modules\\arraylist.php",
"line": 15,
"message": "Creation of dynamic property lib\\App::$arrays is deprecated",
"trace": "#0 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\modules\\arraylist.php(15): exception_error_handler(8192, 'Creation of dyn...', 'C:\\\\xampp\\\\htdocs...', 15)\n#1 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(204): modules\\arraylist->create(Object(stdClass), 'list', Array)\n#2 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(144): lib\\App->execSteps(Object(stdClass))\n#3 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(133): lib\\App->exec(Object(stdClass), false)\n#4 C:\\xampp\\htdocs\\datastore_test\\dmxConnectLib\\lib\\App.php(111): lib\\App->exec(Object(stdClass))\n#5 C:\\xampp\\htdocs\\datastore_test\\dmxConnect\\api\\users\\registration\\usr_login_copy.php(7): lib\\App->define(Object(stdClass))\n#6 {main}"
}

That is indeed a different error, I assume you use PHP 8.2 when getting this error.

Here an update for you:

App.zip (2.2 KB) unzip to dmxConnectLib/lib.

1 Like

I use php 7.4.33

But this app works for me… No errors.

Thanks but the api i have is very complex, with multiple querys (and custom querys) :slight_smile:

Fixed thanks!,
Should I update app.php too? (Using PHP 7.0.3)

1 Like