Support

Home Forums Event Espresso Premium Event App Customization plugin causes media library to not load

Event App Customization plugin causes media library to not load

Posted: April 23, 2018 at 4:18 pm


communityed

April 23, 2018 at 4:18 pm

After installing and activating the Event App Customization plugin, The Media Library component in WordPress stops working. It just displays a blank screen with the loading graphic spinning endlessly. Once I disabled the plugin, it works fine. Running the latest version of WordPress and latest version of EventEspresso and latest version of the plugin.


Josh

  • Support Staff

April 23, 2018 at 4:30 pm

Hi there,

I checked, and I’m not seeing this issue on the testing sites. May I ask is this happening on a specific admin route? For example, is this happening only when you add a featured image to a post, or an image to a post, and/or the WordPress > Media > Add New page?


communityed

April 24, 2018 at 1:39 am

Hello Josh,

Thanks for looking into this. Not only does it break the Media Library functionality in WordPress but it also breaks the Event Cart where events fail to add to the cart and a blank box is displayed when you try. Everything goes back to normal when I disable the plugin. The entire WordPress > Media > Library fails to display any content. Also if I try to add an media, I get an error message but the file actually uploads to the server. Once I disable the plugin, I can see the content I uploaded. You can take a look at the Event Cart issue here since I still have the plugin enabled (http://www.lamission.edu/communityedwp/index.php/courses/test/). Try adding the event to the cart and you will see what happens. My WordPress setup is running on Windows IIS with the FastCGI php handler (also latest version). If you need admin access to the wordpress site, let me know and I’ll provide access.


communityed

April 24, 2018 at 1:48 am

Some more debugging info for you. When the plugin is enabled. the JSON post response for adding events as well as trying to load the media library includes the text “No image url provided when trying to create an image attachment.” after the JSON object. Again, once the plugin is disabled, that message is no longer included in the HTML response.


communityed

April 24, 2018 at 1:57 am

Based on my software development knowledge, I think what may be going on here is the HTTP response includes the erroneous text “No image url provided when trying to create an image attachment” along with the JSON object resulting in JavaScript failing to parse the JSON string into a JavaScript object for updating the DOM. So it basically errors out and the AJAX call fails to update the page. Now why the server is returning an invalid JSON response based on that plugin being enabled is hopefully something you can figure out. Just my two cents…


Tony

  • Support Staff

April 24, 2018 at 2:56 am

Hi there,

I think what may be going on here is the HTTP response includes the erroneous text “No image url provided when trying to create an image attachment” along with the JSON object resulting in JavaScript failing to parse the JSON string into a JavaScript object for updating the DOM. So it basically errors out and the AJAX call fails to update the page.

Yeah, that’s the problem.

The reason you are getting the ‘No image url provided when trying to create an image attachment.’ error is due to not having a logo set within either:

Event Espresso -> App Customization -> App Logo Image

or

Event Espresso -> General Settings -> Company Logo

So the app customization add-on doesn’t have an image to use and when it tests both those locations and finds them empty, it throws an exception with the above message which we write to the error log using:

catch (EE_Error $e) {
    error_log($e->getMessage());
    return;
}

It seems your server is set to display the errors rather than log them, but only within the admin calls and as all of the ajax requests are considered to be admin they break. So when the exception is thrown it outputs the error and if is an ajax request, it breaks.

I will create a ticket for our developers to investigate this further, although a quick fix that should work on your site is to add an image to either of the above locations, you can just manually enter the URL of an image on your site, for example:

http://www.lamission.edu/communityedwp/wp-content/uploads/2018/04/LAMC-CommunityEd-Logo2.png

Once you have a URL set, the media library should then work again and you can use it to select another if preferred.

Or set up your server not to output errors directly to the page when in production (including outputting errors to the admin) and just log them to the error logs so you can view them there.


communityed

April 24, 2018 at 11:24 am

Hi Tony,

That makes sense now and after pasting the URL in the company logo area, it solved the issue. However, now I remember why no company logo was set during the initial setup. When I click on the “Upload Image” button and upload a logo (or select an existing one). I cannot insert/set it by clicking the “Insert Into Post” button in the media library. If I do, nothing happens which is why I skipped it. I didn’t know I could also set it by pasting the URL into the “Upload New Logo” text field (since it’s not intuitive due to the field name). So the issue with the company logo field is two-fold here. First, I’m unable to select an existing logo from the media library due to an unknown reason and two, the field name is not clear that I can also paste in a URL and it would apply. So I guess this company logo issue is what caused the AJAX issue due to how errors are logged on my site (I’ll look into this on my own).

Thanks for looking into this


communityed

April 24, 2018 at 11:30 am

I forgot to mention the above post is related to the company logo settings by going to Event Espresso -> General Settings -> Company Logo, not the logo set in the app customization area.


communityed

April 24, 2018 at 11:54 am

Here’s some info you may want to add to your installation documentation for windows systems. It turns out that the php.ini file (production version) that is included with the windows PHP FastCGI module has the following commented out:

; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog

This causes the errors to output to the browser. In windows, the error_log should be set to syslog. I must have overlooked it when I was installing php and I don’t know why they didn’t set this as a default since the distro is Windows specific. Anyway, hope this info saves someone else some headache in the future if they run into the same situation.


Tony

  • Support Staff

April 25, 2018 at 2:36 am

When I click on the “Upload Image” button and upload a logo (or select an existing one). I cannot insert/set it by clicking the “Insert Into Post” button in the media library. If I do, nothing happens which is why I skipped it.

That usually happens when something changes the wp setting image_default_link_type to none, you can check this by opening up {domain}/wp-admin/options.php

Search for ‘image_default_link_type’ and see what value is set for it, the default is ‘file’.

If it is set to something else, then something on your site updated the option and expects it to be that way, so I don’t recommend changing it but it’s easy enough to work around.

When you select the image and show the options, ‘File URL’ will be empty – http://take.ms/Y5vax

That’s the field passed over to the text field so if it’s empty you get nothing, if the above option was ‘file’ you would have a URL to your image in that field by default and then clicking ‘Insert into Post’ works. If it’s empty just click on the ‘File URL’ button just below it and the field should populate with the URL, then click insert into post – http://take.ms/bTYbO

I didn’t know I could also set it by pasting the URL into the “Upload New Logo” text field (since it’s not intuitive due to the field name).

May I ask what you would prefer the field was named?

It’s essentially just a text field that holds the URL, you can put whatever you want there. WP provides the media library and that’s what the majority of people will use but there’s nothing we can do to prevent the above issue without likely conflicting with other plugins (any plugin which alters the above option), you can also add a URL to an external image in that field if preferred.

I forgot to mention the above post is related to the company logo settings by going to Event Espresso -> General Settings -> Company Logo, not the logo set in the app customization area.

Strange, if you have that problem in General Settings you should also see the same on App customization.

Here’s some info you may want to add to your installation documentation for windows systems…

Whilst we appreciate you taking the time to post the cause and solution, officially we don’t support windows installs so we don’t have any Windows documentation to add that to but I’m glad its now working for you.

The support post ‘Event App Customization plugin causes media library to not load’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso