Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error editing (by admin) of OWN cache submitted for review #2115

Open
andrixnet opened this issue Oct 11, 2019 · 4 comments
Open

Error editing (by admin) of OWN cache submitted for review #2115

andrixnet opened this issue Oct 11, 2019 · 4 comments

Comments

@andrixnet
Copy link
Contributor

andrixnet commented Oct 11, 2019

On OCNA, this cache has been submitted for review:
https://www.opencaching.us/viewcache.php?cacheid=2943

It is of type "OWN CACHE". When admin tries to edit this cache (or access the edit page), an error is generated (and mailed).

Checking error emails I believe this might be it:

ErrorException: Undefined offset: 10



#0 /serve/www/oc_us/oc/editcache.php(748): src\Utils\Debug\ErrorHandler::handleError(8, 'Undefined offse...', '/serve/www/oc_u...', 748, Array)

#1 {main}
@rapotek
Copy link
Contributor

rapotek commented Oct 11, 2019

It is not only OCNA problem. The error will occur if an admin tries to edit a cache where:

  • there is a limit per user set in config for the cache type
  • admin has not any caches of this type

In short the line number 748 in editcache.php which is now:

if (isset($config['cacheLimitByTypePerUser'][$cache_type]) && $cacheLimitByTypePerUser[$cache_type] >= $config['cacheLimitByTypePerUser'][$cache_type] && !$usr['admin']) {

should be something like this:

if (isset($config['cacheLimitByTypePerUser'][$cache_type]) && isset($cacheLimitByTypePerUser[$cache_type]) && $cacheLimitByTypePerUser[$cache_type] >= $config['cacheLimitByTypePerUser'][$cache_type] && !$usr['admin']) {

or maybe better the !$usr['admin'] should be moved to the front of if conditions checking in this line and the others nearby, too.

@harrieklomp
Copy link
Member

harrieklomp commented Oct 11, 2019

This should be solved when PR #2087 is approved.
In US database the id for 'Own cache' is 11 or 99 ?. In software it is 10.

Selectie_393

Selectie_394

@harrieklomp
Copy link
Member

Just tested it to change cache type for that cache to ID 11. Then there is no error.
Replaced to original state with ID 10 then there is the error again.

@harrieklomp harrieklomp added the OCNA migration temporary label to fast find issues label Oct 13, 2019
@harrieklomp
Copy link
Member

@rapotek , you are correct It looks also like a common problem.
When edit cache as admin for webcam cache https://www.opencaching.nl/viewcache.php?wp=OB1B20 it produce the same error:

ErrorException: Undefined offset: 5



#0 /serve/www/oc_www/oc_www/editcache.php(748): src\Utils\Debug\ErrorHandler::handleError(8, 'Undefined offse...', '/serve/www/oc_w...', 748, Array)

#1 {main}

rapotek added a commit to rapotek/opencaching-pl that referenced this issue Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants