• Hi there,
    As of today, I am no longer able to edit my custom field at all. We have been using the plugin to display different quotes on our product pages for about a year now and randomly today, the box is grayed out on the admin side and we can’t change anything or add any new quotes to new products. I have not changed anything at all and haven’t added any new plugins.
    An example of a page on our site with a quote in lime green below the product description (There are over 600 pages using this plugin): https://www.stoptheboring.com/product/t-bone-steak-glass-blown-ornament/

    Thanks for your help! This is something that we really need!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    We have the same problem at the back end we cannot use the admin fields in our products anymore after the last update..

    Best regards,

    Plugin Author Saravana Kumar K

    (@mycholan)

    Hi, in that field’s configuration, please check for the “Read Only” option, whether it has been set to “Show as Read Only” or “Show as Normal”, it should be “Show as Normal”.

    Hi Saravana,
    yes wel did this and works but I need to change a more than 100 fields.
    is there a bulk change possible?

    and normaly this “Show as Read Only” or “Show as Normal” is or was an option for the front end. will this be the same?

    Plugin Author Saravana Kumar K

    (@mycholan)

    No problem, I will post a snippet for the bulk update shortly.

    ok Perfect!

    Plugin Author Saravana Kumar K

    (@mycholan)

    Create a Page in your Back end Admin, name of the page should be Migrate.

    Create a .php file in your active theme directory, name of the file should be page-migrate.php

    place the below snippet on that file.

    /* Fetching all the fields factory admin post */
    $posts = get_posts(array('post_type'=>'wccaf', 'posts_per_page'=>-1));
    
    if( count( $posts ) > 0 ) {
    	
    	/* Go through each post */
    	foreach( $posts as $post ) {
    		setup_postdata( $post );
    		$_pid = absint( $post->ID );
    		
    		/* Fetch all fields from a post */
    		$meta = get_post_meta( $_pid);
    		
    		/* Iterate through each field */
    		foreach ( $meta as $key => $val ) {
    			if ( preg_match( '/"wccaf_"/', $key ) ) {
    				if ( $key != 'wccaf_condition_rules' &&
    						$key != 'wccaf_location_rules' &&
    						$key != 'wccaf_group_rules' &&
    						$key != 'wccaf_pricing_rules' &&
    						$key != 'wccaf_fee_rules' &&
    						$key != 'wccaf_sub_fields_group_rules' ) {
    							/* Decoade the meta of a single field */
    							$field = json_decode( $val[0], true );
    							if ($field && isset($field["show_as_read_only"])) {
    								/* Update the read only proprty */
    								$field["show_as_read_only"] = "no";
    								/* Update the meta */
    								update_post_meta( $_pid, $key, wp_slash( json_encode( $field ) ) );
    								echo '<p>'. $key .' updated successfully.</p><br/>';
    							}						
    						}
    			}
    		}
    		
    	}	
    }

    Now from the browser call that page http://your-site-url.com/migrate

    That call will execute the snippet on the page-migrate.php, once done delete that file from your active theme directory.

    Check your admin fields whether the fields are updated.

    Caution: I haven’t tested the snippet, though it doesn’t contain anything that can corrupt your fields.

    Hi,

    I tried it a few times but it doesn’t change to Show as Normal.
    only if I make a new Field it is on Normal automatically(i believe it was already standard.

    best regards,

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Fields no longer editable’ is closed to new replies.