After update of the core settings module from 2.0.4 to 2.0.5 no new updates are shown

Laraship QuestionsCategory: issues & BugsAfter update of the core settings module from 2.0.4 to 2.0.5 no new updates are shown
martin asked 6 years ago
After update of the core settings module from 2.0.4 to 2.0.5 no new updates are shown besides there are updates available for several other modules. I found the reason in /Corals/core/Settings/Classes/Modules.php@checkForUpdates() : the line
if (isset($check_updates_result['has_updates'])) {
has no effect as the json returned hasn't the key 'has_updates'. Instead I I used the following line:
if (isset($check_updates_result['updates']) && count($check_updates_result['updates']) > 0 ) {
martin replied 6 years ago

I guess this issue has the same bug:
https://www.laraship.com/question/update-status-available-but-cant-update-it/

2 Answers
laraship Staff answered 6 years ago

Hello, 
2.0.5 is the latest version we have and once we have new updates you will receive them
 

martin replied 6 years ago

I know it’s the latest version – but there is a bug in it. Please read my post above. I just want to help to fix it.

laraship Staff replied 6 years ago

ah Ok, sure will add this to the next release, thanks for pointing that 🙂

laraship Staff replied 6 years ago

but its has_updates not updates

laraship Staff answered 6 years ago
so I assume it should be like this  
if ($check_updates_result['status'] != "error") {
if (isset($check_updates_result['updates']) && count($check_updates_result['updates']) > 0) {
$remote_updates = $check_updates_result['updates'];
}
if (!$check_updates_result['has_updates']) {
flash(trans('Settings::labels.module.up_to_date'))->success();
}
}
martin replied 6 years ago

there was no json key ‘has_updates’ but there were updates in json key ‘updates’

laraship Staff replied 6 years ago

There is both

martin replied 6 years ago

I looked at the line at /Corals/core/Settings/Classes/Modules.php@checkForUpdates() :

$check_updates_result = json_decode($res->getBody(), 1);

and then I did a:
dd($check_updates_result);

and there where ‘updates’ but no ‘has_updates’ – that’s the point.