Support

Account

Home Forums Backend Issues (wp-admin) Conflict with Themify Builder: Posts not saved anymore

Solving

Conflict with Themify Builder: Posts not saved anymore

  • After going through 40 plugins to find, who is responsible, I finally found the pair that does not get along too well:
    1. ACF
    2. Themify Builder (free theme that has a builder inside: http://themify.me/themes/basic)

    Reproduce
    1. Install themify theme
    2. Install ACF
    3. Goto “create a new page or post”
    4. Make sure, the themify builder panel is activated in the screen options
    5. You may notice how drafts save successfully, automatically
    6. try Publishing
    –>page never refreshes, the spinning wheel spins but does not publish the page/post.
    7. Remove builder panel from view
    –>Saving works

    I told Themify about it, but of course they have no access to premium ACF and cannot replicate.
    I am just a suffering user and want to prevent support-ping-pong (one blames the other and takes no action)

    Help me out of this dilemma, please.

    Carsten

  • I will flag this topic for the developer to look at.

    Have you put in a support ticket? http://support.advancedcustomfields.com/new-ticket/

    More than likely there is a JavaScript conflict, if you can it would probably be helpful to them if you include any JavaScript error that may be happening.

  • Hi @eumetsat

    Thanks for the bug report.

    I’ll do some testing and get back to you shortly

    Thanks
    E

  • Thanks for looking into that. I see NO Javascript errors when the button is pressed. The button goes inactive, I see the spinning wheel and that was it.

  • This is just a guess, but it sounds like a PHP error on thee server during the AJAX call is causing it not to return anything, or it’s outputting the error.

    Turn on debugging on your site

    
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    

    After turning on debugging try to save the post then look at the log, it should be located at /wp-content/debug.log

    See if there’s any errors and what they are.

  • I’ve been having the same problem since mid-May. I just turned on debugging and this showed up in the log when I tried to save a post:

    [15-Jul-2015 21:28:11 UTC] PHP Notice: Trying to get property of non-object in /web/tcr/wp-content/plugins/themify-builder/classes/class-themify-builder.php on line 613

    and that line is:
    ‘post_ID’ => $post->ID,

    Themify’s builder component is included in their free themes at http://themify.me/themes/free-themes

    ACF Pro v5.2.7
    Builder v1.3.8

    WP 4.2.2
    PHP 5.6.10
    MySQL 5.5.42

    Has also been reported on their support site at http://themify.me/forum/topic/acf-plugin-and-active-builder-module-dont-save-pagesposts (requires login)

  • Hi guys,

    I’ve just done some debugging and found some interesting info.
    If possible, can you put me in contact with the theme developer as I would like to work together to find a compatibility for the issue.

    Bellow is a snippet of code from the file themify.builder.admin.ui.js:

    
    if( $('#themify_builder_row_wrapper').is(':visible') ){
    	var self = ThemifyPageBuilder,
    		_this = $(this);
    
    	if( !self.isPostSave ){
    		self.saveData(false, function(){
    			self.isPostSave = true;
    			$('input#publish').trigger('click');
    		});
    		e.preventDefault();
    	}
    	else{
    		self.isPostSave = false;
    		return true;  
    	}
    }
    

    This is run when the publish button is clicked. All works well, except for the ‘else’ statement. The ‘else’ statement is setting isPostSave back to false, which prevents ACF from submitting the form after it validates the data.

    This is what happens:
    1. Click save
    2. Themify saves data via JS and prevents the event from continuing (if)
    3. Themify triggers click on the submit button when JS save is complete
    4. ACF then performs it’s own JS validation in a similar way
    5. Themify is triggered again and sets it’s isPostSave variable to false (else)
    5. ACF triggers a click on the submit button when validation is complete
    6. Themify JS triggers again and prevents the event from continuing (if).

    To fix the issue, I believe the themify JS should not change isPostSave to false during the else statement. I suggest changing the code to:

    
    if( $('#themify_builder_row_wrapper').is(':visible') ){
    	var self = ThemifyPageBuilder,
    		_this = $(this);
    
    	if( !self.isPostSave ){
    		self.saveData(false, function(){
    			self.isPostSave = true;
    			$('input#publish').trigger('click');
    		});
    		e.preventDefault();
    	}
    	else{
    		return true;  
    	}
    }
    

    This allows themify to save data only once, and then allow any other JS to work as normal.

    Let me know what you hear back from the dev (please pass on the above comment to them).

    Thanks
    E

  • I will pass this to themify and see their response – many thanks for the elaborate finding!

  • Awesome, this fix is working for me. The snippet starts on line 1055 in /wp-content/themes/plugins/themify-builder/js/themify.builder.admin.ui.js (for the plugin, will be different path for themes)

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Conflict with Themify Builder: Posts not saved anymore’ is closed to new replies.