Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • jcleavelandjcleaveland
    Participant

    Hi Anh,

    It must be some issue with the group being within a set of tabs, but I have tried all of those methods of setting the default value and it works in the tab outside of the group, but not in the group that is also in the tab.

    The handlebars around the 'group_title' are not working either except for the {#} in all other cases, it prints that actual handlebars to screen as a string.

    The full code is here if you want to do some testing: https://bit.ly/2CXk8Ne

    I can bypass each of those issues for now, the real issue is with the file delete. I'll follow up on that one in the other thread.

    Thanks!

    jcleavelandjcleaveland
    Participant

    That's basically it. The only difference is that I have several MetaBoxes per post type with several fields all writing to their own tables.

    I also have several things hooked to save_post... there could be something in there causing the issue.

    We can close this for now as I'm thinking it must be on my end somehow. I'll let you know if I discover anything else related to this issue.

    Thanks again!

    in reply to: submit form with ajax #15260
    jcleavelandjcleaveland
    Participant

    Reviving this one for another +1

    jcleavelandjcleaveland
    Participant

    Hi Anh,

    I have an update.

    I discovered that the issue was actually occurring for all front-end select_advanced or select fields with multiple set to TRUE regardless of whether there are multiple MetaBoxes or not.

    I had come across this with another metabox and created a workaround that led me to believe it wasn't happening.

    The workaround hooks rwmb_{metabox_id}after_save_post and strips the string notation off of the serialized array.

    Like so:

    function obh_update_group_primary_contact($post_id) {
      global $wpdb;
      $table = $wpdb->prefix . '_group_contact_info';
      $result = $wpdb->get_row(
        "SELECT * 
        FROM $table 
        WHERE ID = $post_id"
      );
     
      $primary_contact = $result->obh_group_primary_contact;
     
      $string_query = stripos( $primary_contact, 's:' );
        
      if($string_query !==false) {
         $ass_array = preg_split('/^[s]\:([1-9][0-9]{0,2})\:\"/', $primary_contact);
        $string_1 = $ass_array[1];
        $string_2 = rtrim($string_1,'";');
      } else {
        $string_2 = $primary_contact;
      }
      
      if($string_2){
        $wpdb->update(
          $table,
          array('obh_group_primary_contact' => $string_2),
          array('ID' => $post_id )
        );
      }
    }
    
    add_action( 'rwmb_obh_group_description_after_save_post', 'obh_update_group_primary_contact' );

    As far as I'm concerned, this is solved for me. Please let me know if you uncover a better way to address it in core. I'm always happy to implement your updates.

    Thanks for all your hard work and the tremendous plugins!

    jcleavelandjcleaveland
    Participant

    Hi Anh,

    Yes, each of the MetaBoxes writes to a separate table.

    I should also clarify that the issue is only present when the field is set to select_advanced and multiple is set to TRUE. When selecting only a single item, the string is recorded in the DB as expected.

    Any thoughts?

    Thanks!

    in reply to: Method to create setting pages for Network Admin #13823
    jcleavelandjcleaveland
    Participant

    Hi,

    Just following up on this. Is there a way to create settings pages for the network?

    Thanks!

    in reply to: Front-end validation messages #11085
    jcleavelandjcleaveland
    Participant

    Hi Anh,

    I'm sorry I wasn't more clear, yes, I updated the validate.js file with your updated code. It is still not working.

    Would it be valuable to work directly on my site? I an give you access to a dev environment if you'd like.

    Thank you!

    in reply to: Custom table saving data in all custom tables #11066
    jcleavelandjcleaveland
    Participant

    I cannot replicate this with any consistency. It was doing earlier, but now it's not. I have so many things tied to save_post, add_post_meta, wp_insert_post_data and the metabox hooks that I was probably doing something wrong.

    Unless you find something, let's close this one and I'll reopen it if I find something again later.

    Thanks again!

    in reply to: Taxonomy not displaying after update #11065
    jcleavelandjcleaveland
    Participant

    It works!

    Thanks again for the great support!

    in reply to: Front-end validation messages #11064
    jcleavelandjcleaveland
    Participant

    Hi Anh,

    I do 99.9% of my editing from the front-end. I just made an edit from the backend and the validation works there as expected. I apologize for not being more clear and more timely in my communication there.

    I am still getting nothing for the front-end though.

    I use the front-end form in a bootstrap modal, I'm not sure if that could be the issue.

    Thanks for all your help!

    in reply to: Front-end validation messages #11027
    jcleavelandjcleaveland
    Participant

    Hi Anh,

    I updated my code so that the validation rules are a parameter of the Metabox and not the fields. I also updated the metabox plugin validate.js file to reflect the changes.

    I also confirmed that Metabox and all other Metabox.io plugins are up to date.

    I am still getting no validation.

    A couple of things to note:
    1. The required symbol (*) is now displaying - it wasn't before.
    2. After this change, the required attribute no longer works.

    There are no errors in the console.

    Let me know what more I can do to be helpful.

    Thanks!

    in reply to: Front-end validation messages #10872
    jcleavelandjcleaveland
    Participant

    Hi Anh,

    I have not been able to get the validation rules to work (front-end or back-end). When I include the custom validation code, the display of the page on both the front-end and the admin gets messed up. I am using a JavaScript masonry code to display the Metaboxes on the front-end. I have some custom CSS on the back end, but nothing too outrageous. There are no errors displayed in the console.

    The front-end should look like this: https://www.dropbox.com/s/1t69as0hiyb2jwt/correct-display.jpg?dl=0

    Instead it looks like this: https://www.dropbox.com/s/ntk1pm93knx9xmm/with-cutom-validation-code.jpg?dl=0

    The admin looks like this: https://www.dropbox.com/s/cqeg0qjyg9s9kcl/backend%20error.gif?dl=0

    Instead it should look like this: https://www.dropbox.com/s/gku2ydcowfsc3sa/backend-normal.gif?dl=0

    (all links are downloadable)

    I can get the "required" custom attribute for the field settings to work just fine, but not the custom validation rules (some sort of JavaScript issue).

    The "required" custom attribute works well for the majority of situations, but not for checkbox lists. With a checkbox list, the "required" custom attribute requires all check-boxes to be checked in order for the form to validate.

    This what it looks like: https://www.dropbox.com/s/pmkd635yjom58uu/with-required-custom-attribute.jpg?dl=0

    I only need one or two boxes to be checked in order to validate. I'd also like a custom message.

    I realize this is a complex issue involving many different parts and several potentially conflicting scripts. In the event that I cannot get a custom message, just modifying the core code to accommodate a checkbox-list would be sufficient for my needs.

    Here is the complete code for the Metabox: https://gist.github.com/obodohub/15d9f02f1807845fa3fa0b2ef9a3b88a

    Let me know your thoughts.

    Thanks!

    in reply to: Front-end validation messages #10855
    jcleavelandjcleaveland
    Participant

    I'm sorry to keep posting, but this is unfolding rapidly. I won't post again until you respond.

    I found a typo in the above code. I was missing a couple of commas which was leading to an unexpected string error. After I fixed that I got this error. Then I moved the code to the footer after all scripts are enqueued thinking I might not have the validate script available yet but I am still getting this error.

    Any ideas? Thanks!

    Uncaught TypeError: $(...).validate is not a function
        at HTMLDocument.<anonymous> (?rwmb-form-submitted…bh_member_tags:2279)
        at j (jquery.min.js?ver=4.9.7:2)
        at Object.fireWith [as resolveWith] (jquery.min.js?ver=4.9.7:2)
        at Function.ready (jquery.min.js?ver=4.9.7:2)
        at HTMLDocument.I (jquery.min.js?ver=4.9.7:2)
    (anonymous) @   ?rwmb-form-submitted…bh_member_tags:2279
    j   @   jquery.min.js?ver=4.9.7:2
    fireWith    @   jquery.min.js?ver=4.9.7:2
    ready   @   jquery.min.js?ver=4.9.7:2
    I   @   jquery.min.js?ver=4.9.7:2
    in reply to: Front-end validation messages #10854
    jcleavelandjcleaveland
    Participant

    Hi again,

    I've tried with something like this inline inside the modal that I use for front-end editing to no avail.

    It works here: http://jsfiddle.net/AsuyC/298/

    but I'm not seeing how I can accurately access the form by the class.

    Any Ideas?

    
    $(document).ready(function () {
        $('.rwmb-form').validate({
            rules: {
                'obh_member_membership_tags[]': {
                  required: true
                },
                'obh_member_cohort_tags[]': {
                  required: true
                },
                'obh_member_needs_tags[]': {
                  required: true
                }
                'obh_member_grant_tags[]': {
                  required: true
                }
            },
            messages: {
                'obh_member_membership_tags[]': {
                  required: 'Select a member tag'
                },
                'obh_member_cohort_tags[]': {
                  required: 'Select a cohort tag'
                },
                'obh_member_needs_tags[]': {
                  required: 'Select a needs tag'
                }
                'obh_member_grant_tags[]': {
                  required: 'Select a grant tag'
                }
            },
        errorPlacement: function (error, element) {
            error.insertBefore(element);
        },
        });
    });
    
    in reply to: WP All Import/Export Add-on #9573
    jcleavelandjcleaveland
    Participant

    Hi Anh,

    Just following up here. Is this on the roadmap? I'd love it if it could work with the custom tables add-on. It would totally change my world!

    I could send my clients a single spreadsheet to format their data and then use the import tool to create the posts, assign taxonomies and break the data into it's custom tables tables in one step.

    Thanks for your ongoing support!

Viewing 15 posts - 1 through 15 (of 31 total)