Code:
PHP-Version: 7.4.1
Error Line:
if($this->allianceData['ally_owner'] == $USER['id']) {
The error means that your query don't receive a row. then he give a boolean. and you try to access the boolean. You can try this:
if($this->allianceData['ally_owner'] ?? 'default value' == $USER['id'] ?? 'default value') {
Since I don't know your entire code, I assume that you have already checked whether the user is authenticated? Either via middleware or in the code above.
$this->allianceData or $USERI recently had this problem, the solution for me turned out to be extremely simple and thought I would just note it down to hopefully save someone a bunch of searching for nothing!
If your errors are being displayed in the backend of your site, in a form, on a settings page, this might help you.
Essentially we are requesting an element of an array but in my instance the array was not created yet, I wrote into the fields displaying the error then saved the form. Thus, creating the array, adding the values to the array for future calls. On reload, the page worked!
if($this->allianceData['ally_owner'] ?? 'default value' == $USER['id']) {$this->allianceDataOR$USERis a boolean and not an array. No other assumptions can be made from what is provided.