/    Sign up×
Community /Pin to ProfileBookmark

problems accesing admin page, I get OW Debug Notice. can anyone help?

Every time I try to access the admin page of my website it tell me the following:

OW Debug – Notice
Message: Undefined offset: 0
File: /home/luisafer/public_html/ow_system_plugins/admin/components/admin_menu.php
Line: 74

I went to that line and it says this from line 71 up to 75:

public function getFirstElement()
{
usort($this->menuItems, array(BOL_NavigationService::getInstance(), ‘sortObjectListByAsc’));
return $this->menuItems[0];
}

What am I doing wrong?

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJan 27.2016 — My first guess would be that $this->menuItems is empty at that point.
Copy linkTweet thisAlerts:
@LatinasauthorFeb 02.2016 — My first guess would be that $this->menuItems is empty at that point.[/QUO

What should I write then? thanks for answering!
Copy linkTweet thisAlerts:
@NogDogFeb 02.2016 — Depends on whether the fact that it's empty represents a bug you need to fix, or a valid situation you just need to handle. You could avoid *that* error message by something like this, but that doesn't mean you won't then run into another problem:
[code=php]
public function getFirstElement()
{
usort($this->menuItems, array(BOL_NavigationService::getInstance(), 'sortObjectListByAsc'));
return isset($this->menuItems[0]) ? $this->menuItems[0] : false;
}
[/code]

But then you'd have to figure out what to do when you call that function if it returns Boolean false.
Copy linkTweet thisAlerts:
@LatinasauthorFeb 03.2016 — Depends on whether the fact that it's empty represents a bug you need to fix, or a valid situation you just need to handle. You could avoid *that* error message by something like this, but that doesn't mean you won't then run into another problem:
[code=php]
public function getFirstElement()
{
usort($this->menuItems, array(BOL_NavigationService::getInstance(), 'sortObjectListByAsc'));
return isset($this->menuItems[0]) ? $this->menuItems[0] : false;
}
[/code]

But then you'd have to figure out what to do when you call that function if it returns Boolean false.[/QUOTE]



You're right it does make the message go away but it just makes it a blank page so I still have the same problem of not being able to access the admin page and do any changes to the website. I'm completly lost. Thanks for your help.
×

Success!

Help @Latinas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...