Licenses pagination fail
Licenses pagination fail, don't show all licenses.
sorry me poor english. Juan J.
Same here . But all the license are correctly listed in the sql table ...
Could you please provide more information as I have not been able to replicate this issue
We also cannot duplicate this error on any of our test/reference systems.
So i have a lot of license (320 total Licenses ).The total licenses is showing correctly . When i go to the /admin/licenses its only take 250 ( Showing 1 to 50 of 250 entries) . The license are still correctly assign to user or asset .
I check if every license was still in the license table ..and it does . when i check some assets i'm still able to see the license checkout to it ...but not listed under the view of /admin/licenses
Can you confirm that they're not soft-deleted? (check for deleted_at column)
No there not soft-deleted . The field deleted_at are Null where there license not listed in the view .
I change my dev platform . From iis microsoft to apache centos . The funny thing is that now have got 259 license listed ...9 licenses were added .(The same database was used ) .
The /admin/licenses/9/view is working fine . The licenses with the id 9 is not listed in /admin/licenses/ .Everything seems to be working fine , no error and every other aspect in relation with those licenses seems to be working just fine .
which code version/branch are you using?
This one was the first i tried . v0.3.11-alpha .
I tried this one too: cordeos/snipe-it BETA1
Both are replicating the same issues .
I'm currently learning to use the framework laravel , I would like to know the sql query running to populate the /admin/licenses/ view . I'm learning the way to make views and the syntax of blade that's used for template and the controller ect..
For now after some reading in the code ...have found that getIndex Grab all licenses orderBy ( Created_at ... So i checked a license in mySQL DB that was not listed in the view ...i change the value to a later date and reload my page ...and after that i was able to see it .
But when i do this ...other Licenses with an older date are dismiss from the view ...
@JulienAerts It will be impossible to help without seeing some actual code
Ok but i don't have any log or error . The build use is : v0.3.11-alpha .
The code is the same as in the build . In more recent build the bug is still there . Maybe in your own test you dont have enought License added , so that's why you are not able to see the issue . Or maybe all license added was made in the same time ...so you dont have different date in the field create_at .
Have found in LicensesController.php // Grab all the licenses $licenses = License::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page);
// Show the page
return View::make('backend/licenses/index', compact('licenses'));
So that's why i check the created_at field ...but i'm still far from understanding why it's acting like it does .
Hi change $licenses = License::orderBy('created_at', 'DESC')->paginate(Setting::getSettings()->per_page); to $licenses = License::orderBy('name', 'DESC')->paginate(Setting::getSettings()->per_page);
Now all my licenses are correctly displayed in my view .
So before there was : Showing 1 to 50 of 250 entries and now it's Showing 1 to 50 of 313 entries
I hope it's giving you more information to be able to find what's going on . For my part it's resolve ....but i still don't know why it's not working with the order_by created_at ....Like i say before i don't know the framework Laravel ...and i just begin to learn-it to be able to help you more in your project .
Would you be able to check in your database to see if somehow some of your licenses have no created_at date, or an incorrect, malformed or unrealistic date (i.e. very far in the past or in the future)?
I check and every licenses have a correct created_at . The format is the same for all licenses .
This is an example of a created_at field : 2014-08-12 17:06:51
The license from this example was not listed before i make the change in LicensesController.php
Other information: newest created_at : 2014-09-30 19:15:07 oldest ceated_at : 2014-08-12 17:41:23
Like i already mention in a previous post , before i could change only this field from a license and make-it reappear as i change the date to a more recent one .
i'm sure there is some limits or filter that's applied on the sql query otherwise it's not making sense that when i change the order_by created_at to order_by name my issues is resolve .