Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Fresh install 3.4.2 - custom fields not saving/working! WordPress

  • SOLVED

Please see my original question if you wish: [[LINK href="http://justpaste.it/1efj"]]http://justpaste.it/1efj[[/LINK]]


<strong>OK, so I thought I personally messed something up on my original install as my custom fields were doing very strange things.

I decided, (only because I just started this project) that I would start again and test my custom fields immediately.</strong>


So I downloaded wordpress 3.4.2 from wordpress.org.

Uploaded the wordpress folder to my directory and renamed <strong>wordpress</strong> to <strong>wp</strong> like I normally do.

Added my wp_config details and with debug_mode = true

First thing I notice is...

<strong>Notice: ob_end_flush() [ref.outcontrol]: failed to delete buffer zlib output compression. in /home/sites/fbapps.co.uk/www/suzukibikes/wp/wp-includes/functions.php on line 2504</strong>

But I think this my server setting as I have about 20 wordpress sites on here with custom fields working fine on them.

So ran through the installation process, all OK. No plugins installed, and using twentyeleven theme (as standard - have not touched anything)


I go to post 'Hello World' and try to add a custom field...

I type this in - [[LINK href="http://i.imgur.com/AMuBk.png"]]http://i.imgur.com/AMuBk.png[[/LINK]]

and this is what happens when I click 'Add custom field' - [[LINK href="http://i.imgur.com/JS3jB.png"]]http://i.imgur.com/JS3jB.png[[/LINK]]

OK.. so this weird, so I hit post 'Update' and then check and it's there - [[LINK href="http://i.imgur.com/Z5H02.png"]]http://i.imgur.com/Z5H02.png[[/LINK]]

So this crazy, because it disables my ability to add more than one custom field at a time.

See this screenshot of what happens if I try and update the custom field - [[LINK href="http://i.imgur.com/pUWv1.png"]]http://i.imgur.com/pUWv1.png[[/LINK]]

The button turns to a square and does nothing!


Can anyone please help - I'm desperate! Prize goes to person with a fix!

Thank you all!


====================


I've just check all my other recent wordpress installs on this server and all of them are 3.4.1 - and custom fields work fine!

However I have one other on 3.4.2 - and I'm getting the same issue. I did not notice it before as I was not really using custom fields, only generic post/page stuff.

So it seems its a problem with 3.4.2, on my server.

These are my server properties...

<strong>Operating System : Linux
Server : Apache
Memory usage : 34.14 MByte
MYSQL Version : 5.0.51a-24+lenny5
SQL Mode : Not set
PHP Version : 5.2.6-1+lenny16
PHP Safe Mode : Off
PHP Allow URL fopen : On
PHP Memory Limit : 256M
PHP Max Upload Size : 500M
PHP Max Post Size : 500M
PHP Max Script Execute Time : 30s
PHP Exif support : Yes ( V1.4 )
PHP IPTC support : Yes
PHP XML support : Yes </strong>

Answers (2)

2012-10-10

Christianto answers:

Hi,

did you see something on your error console?


Josh Cranwell comments:

No javascript errors?


Christianto comments:

did you found error on your web browser console?
I think the link you gave to me is a server error log

I'm sure its a JavaScript since updating/adding other dom element ("custom field" fields) its an ajax function.
since the custom field "add" button moving up from its location when you click it..

could it be because the html not rendered correctly.
Can you check if the value saved to database, after you add custom field?
(although the custom field not added/appear & the "add" button move up)


============

you can try to do backup your wp-admin folder
and re-upload wp-admin folder from same version of wordpress zip to see if its not file corrupt.




Josh Cranwell comments:

I've just ran a complete fresh install, downloading 3.4.2 straight from wordpress.org and starting an absolute fresh!

See my updated question.

It appears to be ajax related, but im getting nothing in the javascript console - [[LINK href="http://i.imgur.com/TMIl2.png"]]http://i.imgur.com/TMIl2.png[[/LINK]]

It is adding it to the database - but only if I update the page. If I don't update the page, then custom field changes are lost. This is not normal behaviour as you don't have to update the page to make custom fields apply.

======

I am lost :/


Josh Cranwell comments:

Its a bug... [[LINK href="http://wordpress.org/support/topic/custom-fields-in-342"]]http://wordpress.org/support/topic/custom-fields-in-342[[/LINK]]


Christianto comments:

Thanks for let us know this, I got it too :)
the file causes this is wp-includes/js/wp-lists.js (wp-lists.dev.js - development version)

Just to let everyone know, to fix this I simply put new selector,

[id="add' + m.what + 'sub"]
you can download on https://www.dropbox.com/s/lzsnomx0574sss2/wp-lists.js

or if you use wp-lists.dev.js version by adding define('SCRIPT_DEBUG', true); on wp_config.php
on line 81
from:
if ( !e.is('[id="' + s.what + '-add-submit"]') )
return !wpList.add.call( list, e, s );

to:
if ( !e.is('[id="' + s.what + '-add-submit"],[id="add' + s.what + 'sub"]') )
return !wpList.add.call( list, e, s );


As we can see on wordpress [[LINK href="http://core.trac.wordpress.org/changeset?old_path=%2Ftags%2F3.4.1&old=21780&new_path=%2Ftags%2F3.4.2&new=21780#file14"]]code trac here[[/LINK]]

the selector is change from class to id,
so the button to add the metafield not selected since the button id attribute isn't "meta-add-submit" but "addmetasub" ( var s.what in this case "meta" ).

hope its works for you all..


Christianto comments:

[[LINK href="https://www.dropbox.com/s/lzsnomx0574sss2/wp-lists.js"]]This link to download edited wp-lists.js[[/LINK]]

2012-10-10

Dbranes answers:

maybe you have hit the <em>max_input_vars</em> limit in <em>php.ini</em>, for so many custom fields ?

the default is 1000, you could try to increase it to see if that is the case.

See more here:

[[LINK href="http://php.net/manual/en/info.configuration.php"]]http://php.net/manual/en/info.configuration.php[[/LINK]]

<blockquote>How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately). Use of this directive mitigates the possibility of denial of service attacks which use hash collisions.</blockquote>


Josh Cranwell comments:

How would I increase this? Can you elaborate please, my understanding of php is not great. Thanks


Dbranes comments:

if you are using php version >= 5.3.9 then this could be relevant.

You have to locate your php.ini on the webserver.

If you can run this

<?php
phpinfo();
?>

then you should be able to find the php.ini location there.





Josh Cranwell comments:

Thanks

I just showed this to my server guy as I don't have access to php.ini and up'ed to 2000 for a test.

No change :/

But i only have 45 registered custom field meta_keys? Which surely is not that much (its more than normal I know)

I worked out that over all I have 129 Posts with with a total of 2079 custom fields.

Is that abnormally high?

Thanks


Dbranes comments:

ok, it was worth the try ;-)

It's a lot but it should be ok.

Many users have experienced restriction problems (mainly with the menu builder) that have been solved by increasing this variable

see fx. this menu problem
http://wpquestions.com/question/showLoggedIn/id/4290


... there are also other php variables that could be checked ;-)


Josh Cranwell comments:

Hmmm... as you can see I've just updated my question above.

I've just ran a complete fresh install, downloading 3.4.2 straight from wordpress.org and starting an absolute fresh!

============

I've just check all my wordpress installs on the server which are in the last few months and they are all on 3.4.1 - the custom fields work absolutely fine.

However, I do have 1 other site on 3.4.2 and exactly the same problem is occuring but I didnt notice as I don't have much need for custom fields on that site.

So that does mean, I have a problem with 3.4.2 on my server - thank god I have not update others as use custom fields a lot on them.

So do you think I need to change server settings, I had a look at that thread but these lots of threads and I'm not sure what I should be looking at?

Thanks


Josh Cranwell comments:

Hmmm... as you can see I've just updated my question above.

I've just ran a complete fresh install, downloading 3.4.2 straight from wordpress.org and starting an absolute fresh!

============

I've just check all my wordpress installs on the server which are in the last few months and they are all on 3.4.1 - the custom fields work absolutely fine.

However, I do have 1 other site on 3.4.2 and exactly the same problem is occuring but I didnt notice as I don't have much need for custom fields on that site.

So that does mean, I have a problem with 3.4.2 on my server - thank god I have not update others as use custom fields a lot on them.

So do you think I need to change server settings, I had a look at that thread but these lots of threads and I'm not sure what I should be looking at?

Thanks


Josh Cranwell comments:

It's a bug... [[LINK href="http://wordpress.org/support/topic/custom-fields-in-342"]]http://wordpress.org/support/topic/custom-fields-in-342[[/LINK]]


Dbranes comments:

ok, interesting ;-)

thanks for sharing this info