Marc Tiedemann
|
Posted: 17 June 2013 09:45 AM |
|
|
|
Where has the addon gone? I am also having the API error mentioned earlier here, but I just can’t find the GitHub repo. The link from Ryan in the other thread brings me to a 404 page on GT….
|
|
|
Ben Kohl
|
Posted: 17 June 2013 10:52 AM |
# 1
|
|
|
The add-on is available right here on devot:ee. The github repo is no longer open to the public and all support requests are handled here in the forums. What version of the devot:ee Monitor are you using? You may need to update because the API has moved and the old destination may no longer be available.
|
|
|
Marc Tiedemann
|
Posted: 24 June 2013 10:44 AM |
# 2
|
|
|
Ok, I donloaded the latest version (1.2.4) here from devot:ee and updated with Updater, cleared caches but still get the same error:
“The API could not be reached. Please try again later.”
and a couple of PHP errors:
“A PHP Error was encountered
Severity: Notice
Message: Undefined variable: plugin_info
Filename: models/addons_model.php
Line Number: 145
A PHP Error was encountered
Severity: Warning
Message: array_unique() expects parameter 1 to be array, null given
Filename: models/addons_model.php
Line Number: 145”
I’m still on 2.5.5 - might that be the problem?
|
|
|
Ben Kohl
|
Posted: 24 June 2013 10:54 AM |
# 3
|
|
|
That batch of PHP errors is a result of the combination of two things: 1) There is a plugin that is not defined properly though we have not been able to figure out which one it is (we’ve seen this before). There is supposed to be a $plugin_info array at the top of every plugin file and there must be one missing somewhere. 2) The errors themselves are occurring in the EE core due to lack of exception handling so it is beyond our control.
As for the API not being reached, is it possible that you don’t have curl installed on your server?
|
|
|
Ben Kohl
|
Posted: 24 June 2013 11:01 AM |
# 4
|
|
|
Could you please place the following line of code at line 142 of models/addons_model.php? It can help us determine which add-on is causing this problem once and for all. We’ve never experienced it ourselves but many people have brought it to our attention without knowing which plugin is causing the problem.
if ( ! isset($plugin_info) || ! is_array($plugin_info) ) exit("The plugin is : $name");
When you refresh the page where the errors appear, we should find our answer.
|
|
|
Marc Tiedemann
|
Posted: 24 June 2013 11:28 AM |
# 5
|
|
|
Sure, always glad to help!
Here is what I just did:
1. Posted given code onto line 142
Result after refresh was:
The plugin is : xml_encode
I then went and removed that Plugin and the given code from line 142 again.
Now, when clicking on devot:ee Monitor I get “Loading” first and then these PHP errors:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: plugin_info
Filename: models/addons_model.php
Line Number: 145
A PHP Error was encountered
Severity: Warning
Message: array_unique() expects parameter 1 to be array, null given
Filename: models/addons_model.php
Line Number: 145
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: plugin_info
Filename: models/addons_model.php
Line Number: 183
A PHP Error was encountered
Severity: Warning
Message: array_unique() expects parameter 1 to be array, null given
Filename: models/addons_model.php
Line Number: 183
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: plugin_info
Filename: models/addons_model.php
Line Number: 183
A PHP Error was encountered
Severity: Warning
Message: array_unique() expects parameter 1 to be array, null given
Filename: models/addons_model.php
Line Number: 183
As for the question about curl: info.php says:
cURL support enabled
cURL Information 7.22.0
Age 3
(and a lot other stuff from there on)
|
|
|
Ben Kohl
|
Posted: 24 June 2013 01:15 PM |
# 6
|
|
|
Oh, this rings a bell. The real problem is that that particular section of code in the add-ons model uses “include_once()” rather than “include” which means that that class functioncan only be used once per script execution otherwise it won’t load the plugin file the second time and that is why the $plugin_info array does not exist in that case though it is definitely in that file.
As for the other problem with the API connectivity, maybe it is related to the fact that these other errors are disrupting the process that gathers your list of installed add-ons to send to the API. If that gets messed up, the API might be returning a blank response which would explain the error message you are receiving. Can you try disabling all error reporting and see if that helps?
|
|
|
Marc Tiedemann
|
Posted: 24 June 2013 01:40 PM |
# 7
|
|
|
Ben Kohl - 24 June 2013 01:15 PM Can you try disabling all error reporting and see if that helps?
Ok, I went into index.php and added a double-forward-slash to “$debug = 0;”. Is that the procedure you had in mind?
Now, when clicking on devot:ee Monitor there is no “loading” anymore and the PHP Errors are being displayed right away.
*shrugs shoulders*
|
|
|
Ben Kohl
|
Posted: 24 June 2013 01:45 PM |
# 8
|
|
|
It really depends on your environment. We enable/disable debug in the config file which overrides anything that is in index.php. Generally, if debug is 0 or FALSE in EE, there is no error reporting but there can be any number of things re-enabling debug or re-enabling error reporting.
Is debug set to 0 in your control panel script (admin.php if you haven’t changed it)?
|
|
|
Marc Tiedemann
|
Posted: 24 June 2013 02:14 PM |
# 9
|
|
|
OK, yeah it’s set to “0” both in admin.php and in index.php plus I set it to zero in Focus Labs Master Config file resulting in what you see in the attached screenshot.
Still though, PHP errors are still being displayed…
|
|
|
Ben Kohl
|
Posted: 24 June 2013 04:16 PM |
# 10
|
|
|
I’d like to try two things:
1) Can you add this code to line 390 of acc.devotee.php, refresh the CP and recheck for add-on updates, then remove that line of code? It will send the information that is intended for the monitor API to me so I can see what is being sent.
mail('ben@masugadesign.com', "Monitor Debug Information", print_r($data, TRUE));
2) Can you send me the output that is generated when you click “Site debug info” at the bottom of the accessory?
|
|
|
Ben Kohl
|
Posted: 24 June 2013 04:31 PM |
# 11
|
|
|
If you aren’t opposed to core hacks, you could change the two “include_once” calls to “include” in the Addons_model::get_plugins function and that might help.
|
|
|
Marc Tiedemann
|
Posted: 25 June 2013 04:24 AM |
# 12
|
|
|
Ben Kohl - 24 June 2013 04:16 PM I’d like to try two things:
1) Can you add this code to line 390 of acc.devotee.php, refresh the CP and recheck for add-on updates, then remove that line of code? It will send the information that is intended for the monitor API to me so I can see what is being sent.
mail('ben@masugadesign.com', "Monitor Debug Information", print_r($data, TRUE));
Just did that.
Ben Kohl - 24 June 2013 04:16 PM
2) Can you send me the output that is generated when you click “Site debug info” at the bottom of the accessory?
I’m not sure on where to find “Site debug info” really… I looked in the accessory under Add-Ons -> Accessories and in the slide-doen pane itself after clicking the devot:ee Monitor Tab.
|
|
|
Marc Tiedemann
|
Posted: 25 June 2013 04:29 AM |
# 13
|
|
|
Ben Kohl - 24 June 2013 04:31 PM If you aren’t opposed to core hacks, you could change the two “include_once” calls to “include” in the Addons_model::get_plugins function and that might help.
Also just tried that but it seems to break the Acc. completely. Clicking the pane doesn’t do anything then anymore.
Well, I hope that the email will help. Otherwise I would almost be temped to say that we leave things as they are, not? Just saying, I don’t want to eat up too much time of yours. On the other hand I’d be sure glad if it worked (you probably too in meaning of finally getting rid of complaints from users) and if you want to stick with this for a while I am here to help as good as I can.
|
|
|
Ben Kohl
|
Posted: 25 June 2013 10:07 AM |
# 14
|
|
|
The site debug info link should be at the very bottom of the accessory panel. I’m not sure if it still shows up when the accessory fails to load the add-ons. I don’t know how changing the include_once calls to include calls breaks the accessory completely. I did it locally and everything is fine. All I can guess is that there is a conflicting add-on that is messing things up somehow.
If you search all your site’s files for the string “->get_plugins(”, we can see what other add-ons are using the add-ons model and that plugin function in particular.
|
|
|
Ben Kohl
|
Posted: 25 June 2013 10:09 AM |
# 15
|
|
|
Ah, Switchboard uses it. I may have to install that on my development site to see if I can reproduce these issues since I’ve never been able to experience them myself.
|
|
|