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
Make detect_extender_valuetype() return only valid types. (Trac #2878) #2878
Comments
cash wrote on 41110330-05-28 I was able to reproduce by going into my database and deleting the type on a metadata. You'll have to repair your database. I think throwing the exception is probably the right thing to do as it lets you know there is a problem. |
trac user tomv wrote on 41110362-09-22 ok, went into PhpMyAdmin, then
Resulted in two records that did not have the value_type set, changed that value_type to 'text' and now it works. Still no clue how it happened... we will watch this closely... |
trac user tomv wrote on 41110373-10-13 But only on one server. The test server returned zero records when we performed:
So even though database seems correct, still same error :( ... to be continued |
trac user tomv wrote on 41110499-03-28 Now wondering: how is it possible that in ElggExtender get($name),
even though all metadata value_types are either text or integer? Ok... if we dont have some revelation, we will fresh install test/dev sites ...but that means we never know cause of error ... :(( |
cash wrote on 41111266-06-27 Tom - when that happens write out the id of the metadata and then check the database. |
trac user tomv wrote on 41112467-12-07 Well... this is getting interesting. The current warning is now:
Metadate with id=49779 looks good, value_type =integer. But this is getting interesting -and really weird- 'mytestemailhotmail.com' is an old email address used once for testing only! (I think with a now deleted user, but can not be 100% sure, could have been admin as well). So, then tried to find it in ALL elggtables in phpmyadmin with LIKE %% and... strange !..it does NOT exist anymore in database! Need coffee now ... ;) |
cash wrote on 41113044-06-12 It would be in the metastrings table if it is in there. Also "mytestmailhotmail.com" is a string and your database is saying that 49779 is an integer. My guess is that you are looking through a different database than the one this particular test site is using. |
trac user tomv wrote on 41115916-05-14 Shame-shame..., last call I executed indeed on wrong database. On active db it resulted in 6 records without value_type, which we set to 'text' and it works again. |
trac user tomv wrote on 41123635-06-05 ok, I open this one, as we found the bug. After running a certain plugin once, the Elgg database is corrupted. The plugin contains a call:
Obviously, "string" is not a valid type.. but the function that should check it, detect_extender_valuetype, does not care and happily returns this db corrupting value. Until there is clever solution, we suggest, very simple:
|
brettp wrote on 41124385-09-09 Thanks for taking the time to debug this! Confirmed that the above code will crash a site when trying to access metadata with an invalid type. |
Milestone changed to |
Title changed from |
ewinslow wrote on 41124506-02-08 Careful with the suggested fix -- need to change the "=" to a "==", otherwise you'll just always get stuck with 'integer' |
cash wrote on 41204894-08-08 (In [svn:8727]) Fixes #2878 detect_extender_valuetype() makes sure passed value type is valid |
cash wrote on 41253389-12-09 (In [svn:8913]) Refs #2878 fixes detect_extender_valuetype() in trunk |
Original ticket http://trac.elgg.org/ticket/2878 on 41110145-09-08 by trac user tomv, assigned to unknown.
Elgg version: 1.7
In some cases, some admin users, calling
generates a:
This happens on the notification settings for their personal notifications only (first block on ...pg/notifications/personal), but at times also when sending messages.
Inserting:
after line 45 in engine/lib/extender.php solves the issue and it seems to work all again.
Running 1.7.7, problem on 3 different installs, localdev and testing servers, all Ubuntu.
Also see [http://community.elgg.org/pg/forum/topic/691093/]
The text was updated successfully, but these errors were encountered: