Sorry. Operator error on screenshots. Here they are.
Support Forum
looks like I was fooled by the title and wording in here… it says admin pages… I cannot get them to show on admin, but can see the front end…
that said, still have no clue why they happening… there is an explicit check for the condition but on your server its not catching it for some odd reason…
for now, to get rid of the message, edit line 122 where the error is occurring and change
if (in_array($key, $memberRanks)) {
to
if (is_array($memberRanks) && in_array($key, $memberRanks)) {
that will stop the error, but does not tell what the real underlying problem is… and that is worrying for this unique report…
When my crisis is over, I will very much join in your curiosity, because any sample of one is curious! In the meantime, my coder, who just had a baby has gone MIA and even your simple instructions are beyond my experience. Is what you ask done within SP? or does it require FTP? If FTP, can you tell me… how?
Sorry to be a bother…
Bob
within Simple Press… so file wp-content/plugins/simple-press/sp-api/sp-api-common-display.php
find that line 122 and replace the one I said with my one change… will get rid of the error and should have no impact on operation…
Putting that replacement language in results in this failure
Parse error: syntax error, unexpected ‘;’ in /problem-with-post-edit-buttonome/content/07/8498207/problem-with-post-edit-buttontml/wp-content/plugins/simple-press/sp-api/sp-api-common-display.php on line 245
Which seems to have taken the entire site down.![]()
please check your code against mine… you changed one line of code around line 122… how did you get an error at 245? are you sure you only made the one change?
the code you changed is in one routine which goes from 113 – 131… so again, not sure how something broker at 245… you might paste that whole sp_get_user_special_ranks() routine you changed…
Here’s a shot of the code. I had presumed that the difference in line numbers was just the way Text Wrangler pulled it off, at two lines per real line (122 x 2 = 244).
I pulled the line that you can see slightly highlighted: if (in_array($key, $memberRanks)) {
and replaced it, cut and paste, with the line you supplied.
In Text Wrangler, line 122 looks like the second screen shot, included.
well the line of code you have highlighted in the first shot is indeed the correct one to change. I can also conform that Steve’s code change above is correct and safe to use so I have to assume a typing error of some kind when you made the edit.
This is the line of code to change it to – perhaps you could use the raw code button to allow you to copy and paste it:
if (is_array($memberRanks) && in_array($key, $memberRanks)) {
This, of course, only hides the error condition and Steve is quite correct that the error condition makes no logical sense.
I do have one question however. When we asked, early in this thread, for you to expose some data on the screen one of the items returned gave a value of NULL. It has taken me a while I am afraid – but that particular item of data should never return a NULL. Can you tell me what versions of MySQL and PHP you are using there please?
Thanks for the follow up:
We’re using MySql 5.0 and PHP 5.2, with 5.3 available if we want it, all at GoDaddy.
For the coding change, it was a straightforward cut and paste, being careful as I recognized that I’m not expert at this. I can try it again if we want, but given the last result would like to wait until this trip is completed and I’m on the ground for awhile, which will be late this PM Pacific Time, just in case we get the same result or other unexpected outcome.
— Bob
PS — Got it! I copied your insertion code from the email notification of your posting. The email system edited your code, it’s substantially different from the raw code in your most recent message. Given that, I’m going to attempt another replacement now.
Progress. The site stayed up (Thank you!!!). I’ve gone through many of the pages which were troublesome before and many are cleared of the warnings.
The problem pages that remain all seem to be Forum pages, where there are (new, different) warnings in just one part of the page. I’ve included screen shots. I hope that the difference in warnings gives you another clue as to what is happening.
Thanks for the progress!
— Bob
Other Admins reported that their symptoms had disappeared after I sent you the most recent screen shots. I sent them the same shots and asked them to confirm/deny. They denied symptoms. Further investigation was delayed by the airline boarding process, but once in flight, I checked with a secondary browser (new thought: not logged in as Admin), which showed no problem.
I then cleared the cache on the primary, Firefox at the moment. No symptoms. I thought this meant a cure and was actually writing this post to tell you so, but…
When I logged back in as Admin, the same symptoms reappeared. This is true even when using a different browser.
Potentially pertinent facts:
- We upgraded to then-current WP and SP.
- I used the trademark symbol and a graphic when creating a new Forum User Group, ID 4.
- We then discovered the problem.
I’m stumped.
— Bob
These are a little different to the first issue you had. That one makes no logical sense (although there is an outstanding question regarding the data in the database I believe, which may help shed some light).
When we encounter php ‘warnings’ and ‘notices’ we do always put in extra checks for an update – and they do come to light from time to time. But they are not, as such, real errors. Websites running under php are always advised to turn off the reporting of Warnings and Notices because you are often likely to get them. In fact, as you are showing warnings I am surprised you are not seeing more of them as when I have warnings on I usually get a whole bunch of them from core WP code!
As the php.ini file states – a production site should not run with warnings and notices turned on – these should only be used in development environments.
I will write up these two items you sent and we will get checks in for them being empty. But I really do strongly suggest you alter your reporting level.