Jump to content

Upload image problem


Joss
 Share

Recommended Posts

Hello chaps and chappesses.

I have just cobbled together a new dev server (er ... that was hard) using Centos and Webmin.

I have two installs of PW on it, both are working, except neither are uploading images to a standard image field.

The problem seems to be that it all gets stuck with the uploading twirly thing going round and round and round and.....

So, errors:

Fatal error:  Call to a member function getConfigData() on null in <b>/home/aworldcalleddirt/public_html/wire/core/Pageimage.php</b> on line 486
Error:     Call to a member function getConfigData() on null (line 486 of ...../public_html/wire/core/Pageimage.php) 

In console on Chrome:

Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Function.parseJSON (JqueryCore.js?v=1481814737:2)
    at XMLHttpRequest.<anonymous> (InputfieldImage.js?v=119-1481814737:1403)

This is the most recent dev version of PW and I am using php 5.6.* (something)

Nothing helpful in apache logs.

I have dug through various posts and am now dizzy

 

Help.........!

 

Link to comment
Share on other sites

The javascript error is most likely just caused by the php error, which does return html markup instead of the expected json content. So I'd rather expect that php does have some problems on the actual upload of the file / or moving it from the temp folder to it's final location. So I'd rather look into known issues on the php side, even though I cannot help you narrowing it down even more.

  • Like 1
Link to comment
Share on other sites

34 minutes ago, horst said:

Hi Joss,

what is the return value of that js json parse error? It will be a PHP error.

You may have a look into the server reponse of that ajax upload request in the network tab.

 

Hi Horst

How do I find the return value?

In the network tab it is showing:

network-tab.png

Link to comment
Share on other sites

16 minutes ago, LostKobrakai said:

Click on the url part in the table. This will open the details view with a few new tabs to look at.

Do you mean the link on the left under "name"?

If I do that, I end up with headers, preview, response and timing.

Headers just gives files details

Preview is the image, obviously

Response says no response data available 

Timing says stalled.

I am assuming there is something wrong with my php installation - or a module missing or something. This is where I am well and truly out of my depth!

 

Joss

Link to comment
Share on other sites

I saw that. And a few others. I have tried adding  always_populate_raw_post_data = -1 to the ini file, but it didn't seem to achieve anything.

Thought it might be the culprit, too, so that was a let down.

Link to comment
Share on other sites

  • 1 month later...

Came across this issue today when trying to push a PW installation to an AWS server running PHP 5.6.29 on CentOS.  File uploads weren't working with the same getConfigData() error, and front-end image sizing was delivering the same error.

Turns out php-gd wasn't installed by default.  Running sudo yum install php-56gd fixed it for me.

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Ok, here is a strange one running PW 3.0.33 on PHP 5.4.45 and have max image dimensions set up to resize images to 2000x2000 pixels on upload.
Portrait mage upload results in a missing JSON response and the thumbnail just sitting there with 100% progress bar and the spinning wheel.
I can upload landscape images but portrait ones trigger the error. I rotated a portrait image before upload and the same image was uploaded successfully then.

I'm getting this error for portrait images in Chrome:

Uncaught TypeError: Cannot read property 'length' of null
    at XMLHttpRequest.<anonymous> (InputfieldImage.min.js?v=119-1488236130:1)
(anonymous) @ InputfieldImage.min.js?v=119-1488236130:1

in Safari:

TypeError: null is not an object (evaluating 'aM.length')

Any idea what's going on here? Thanks :)

Link to comment
Share on other sites

Try installing the Tracy Debugger module http://modules.processwire.com/modules/tracy-debugger/ .   I believe there is new feature in that module to handle ajax errors like this now, but may also require updating Processwire to a newer version as well.  It might give you more insight into what is causing the error.

 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

FYI :

I just encountered the very same problem and symptoms on a PW 3.0.61 install, on both a local ubuntu server (php 7.0) and distant dirty-test-shared-OVH server.

Doesn't happen on every image, although I can't figure out what the rule is (doesn't seem size nor orientation-related).

Fun-fact : images are indeed uploaded, and show up in the assets' folder, but will not be shown on page edit in admin.

Using Imagemagick core module seems to be a valid workaround.

details ? Same as first post :

Error: 	Uncaught Error: Call to a member function getConfigData() on null in /wire/core/Pageimage.php:486 Stack trace: #0 /wire/core/Pageimage.php(346): ProcessWire\Pageimage->___size(260, 0, Array) #1 /wire/core/Pageimage.php(632): ProcessWire\Pageimage->size(260, 0, Array) #2 /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module(495): ProcessWire\Pageimage->width(260, Array) #3 /wire/modules/Inputfield/InputfieldImage/InputfieldImage.module(558): ProcessWire\InputfieldImage->getAdminThumb(Object(ProcessWire\Pageimage), false) #4 /wire/core/Wire.php(389): ProcessWire\InputfieldImage->___renderItem(Object(ProcessWire\Pageimage), 'images_c46c5e26...', 2) #5 /wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___renderItem', Array) (line 486 of /wire/core/Pageimage.php)

 

Link to comment
Share on other sites

  • 4 months later...
On 14/02/2017 at 2:18 AM, evan said:

Came across this issue today when trying to push a PW installation to an AWS server running PHP 5.6.29 on CentOS.  File uploads weren't working with the same getConfigData() error, and front-end image sizing was delivering the same error.

Turns out php-gd wasn't installed by default.  Running sudo yum install php-56gd fixed it for me.

Thanks for pointing me to the right direction :)

Stumbled upon this issue after moving to a new version of PHP (5.6.x.) Working with Ubuntu here, so in my case the solution was "sudo apt-get install php5.6-gd" followed by "sudo apache2ctl restart" – and the issue is now gone.

  • Like 1
Link to comment
Share on other sites

This may be a bit off-topic for this thread, but I was actually kind of surprised at how many features I had to manually install after updating PHP: php5.6-xml, php5.6-mbstring, php5.6-mysql, php5.6-curl, php5.6-mcrypt, and now php5.6-gd. All features that I would've expected to be there by default.

I guess it's a good thing that there's not too much clutter by default and there are different use cases, but like I said, some of those caught me by surprise.

(Note: I'm using ppa:ondrej/php, so the default Ubuntu package, for an example, might have a different set of features enabled by default.)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...