WordPress.org

Forums

Page Builder by SiteOrigin
$instance dosn't retrieve saved data (18 posts)

  1. masteryo
    Member
    Posted 1 year ago #

    Hello , I'm planning to develop many widgets to work with your builder

    But I found a bug !

    in siteorigin-panels/widgets/widgets.php on line 149 "public function form($instance){"

    $instance should retrieve saved data but it's empty cause you are saving widget's settings as post meta "update_post_meta($post_id, 'panels_data', $panels_data);"

    is there any work around ???

    http://wordpress.org/plugins/siteorigin-panels/

  2. Greg Priday
    Member
    Plugin Author

    Posted 1 year ago #

    Hi masteryo!

    Thanks for letting me know about this issue. I'm going to take a look at it as soon as I get back to the office.

  3. masteryo
    Member
    Posted 1 year ago #

    it's possible to retrieve data in form function , but we need panel id to do that
    like this :

    $global $post
    $all_instances = get_post_meta($post->ID, 'panels_data', true);
    foreach($all_instances $as $i => $instances)
        if($this->panel_id == $i)
           $instance = $instances;

    unfortunately , you are creating panel id in panels.admin.panels.js , so it's hard to get panel id in php
    formHtml = formHtml.replace( /\{\$id\}/g, newPanelId );

  4. masteryo
    Member
    Posted 1 year ago #

    Btw , edit gallery In gallery widget is not working

    error in firebug :
    ReferenceError: event is not defined
    event.preventDefault();
    panels.admin.media.js (line 83)

    You forgot to add event in " click: function(){"
    click: function(event){

  5. masteryo
    Member
    Posted 1 year ago #

    Another Bug Found:
    if we enable "Copy Content to Post Content" I get always php timeout

    // Update the post, removing this action first so we don't infinite loop.
            remove_action('save_post', 'siteorigin_panels_save_post');
            wp_update_post($post);
            add_action('save_post', 'siteorigin_panels_save_post', 10, 2);

    I the above code didn't fix stopping from infinite loop. If i remove it will work fine

  6. Greg Priday
    Member
    Plugin Author

    Posted 1 year ago #

    Your official title is now Bug Finder Extraordinaire :)

    I'll go over all these issues and fix up what I can. Most of the issues seem fixable.

  7. masteryo
    Member
    Posted 1 year ago #

    :) , thanks

    Please let me know once you fix the issue especially the first bug , Cause I'm not able to continue develop widgets without fixing it

  8. Greg Priday
    Member
    Plugin Author

    Posted 1 year ago #

    Just letting you know I haven't forgotten about this thread. I've been really busy with a new theme launch. I'll be getting to these issues soon.

  9. masteryo
    Member
    Posted 1 year ago #

    actually I'v been checking your page builder plugin in github every day looking for updates ,Really thank you for your great support

    Don't forget Please , let me know once you fix it

  10. Greg Priday
    Member
    Plugin Author

    Posted 1 year ago #

    Is Page Builder on GitHub? I haven't put it on myself, but due to popular demand, I'll probably move development there as soon as I find some time.

  11. masteryo
    Member
    Posted 1 year ago #

    Huh? he is using your name that's why I thought is you
    check it out https://github.com/wp-plugins/siteorigin-panels

  12. Greg Priday
    Member
    Plugin Author

    Posted 1 year ago #

    That looks like something by Plugin Mirror that automatically syncs my updates from WP.org to GitHub. That's pretty cool.

    http://www.pluginmirror.com/plugins/siteorigin-panels/

    It looks up to date, so you can keep an eye out for updates there.

  13. masteryo
    Member
    Posted 1 year ago #

    Dear Greg Priday, When do you think the first bug will be fixed?

    Cause if it's going to take time , I'll try to figure out work around

  14. masteryo
    Member
    Posted 1 year ago #

    I was trying to figure out a solution , but I think the only solution is to retrieve data & widget form of opened dialog using ajax

  15. Tenatious
    Member
    Posted 1 year ago #

    Masteryo, would this explain why array data doesn't show in the pagebuiler widget options but it does show on the site?

  16. scottsawyer
    Member
    Posted 1 year ago #

    @masteryo, your code in http://wordpress.org/support/topic/instance-dosnt-retrieve-saved-data?replies=15#post-4655592 really helped me get close. Here is what I had to do to make this work for me.

    public function form ( $instance ) {
        if ( empty( $instance ) ) {
          global $post;
          $all_instances = get_post_meta( $post->ID, 'panels_data', true);
          foreach( $all_instances['widgets'] as $i => $instances ) {
            if ( $this->panel_id == $i ){
              $instance = $instances;
            }
          }
        }
      /*
      awesome code for my custom widget
      */
    }

    In my case, my widget has fields that are loaded dynamically are are used in both the sidebar ( which already works fine ) and in the panels pages, so I just needed a condition for when the $instance is not available to the form function.

    I am so happy now, thanks everyone!

  17. Native Imaging
    Member
    Posted 1 year ago #

    I'm having an issue but only with one domain. For some reason the page content is not saving at all with the page builder. I've tried other page builders, and they seem to work ok, but I cannot replicate this bug on any other website. I may have an issue with my sql tables or something, but after repair and optimization, still getting the same problem..

    has anyone else noticed this bug?

  18. Native Imaging
    Member
    Posted 1 year ago #

    Hmm. Not sure what is going on, but I've checked, repaired, and optimize my sql tables. Also deactivated all plugins, reactivated Page Builder, checked the settings options on and off. Currently, the Page Builder will print the content as html in the visual editor, but then the page builder is clicked again, its all gone..

    The odd thing is, the page builder wont load by default like it used to. I tried another plugin called Visual Composer, and it does save content, but it also doesn't show by default like the page builder does.

    I'm a bit confused as to what might be causing the bug...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Page Builder by SiteOrigin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.