Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • in reply to: ℹ️API add method #43652
    badabingbredabadabingbreda
    Participant

    I'd like to think the method is comparable to wp_insert_post() to insert a record, if the goal is to insert/add a auto-incremented row. But the MetaBox\CustomTable\API::add() returns the number of records returned (which I guess will always be 1 if successful, 0 if unsuccessful for whatever reason) and the wp_insert_post() method returns the newly created ID or a WP_Error object.

    I was expecting the MetaBox add method to return the newly created ID, but found that it didn't. I think returning either an ID or false (not successful) would be returning more valuable information.

    My use case is that I use custom tables to create a model type where I store results for a taken assessment (newly created on submission, need the created ID) and immediately need that ID to store the meta (also custom table) for an arbitrary amount of question results, so not stored in columns but assessmentid,key,value format.

    This marked as a non-support question, so it's rather a 'wouldn't it be more effective to return the created row ID' kinda topic.

    in reply to: recent update breaks site #39532
    badabingbredabadabingbreda
    Participant

    Same here

    in reply to: Views is broken #39483
    badabingbredabadabingbreda
    Participant

    Okay, client replied, gave me super admin privileges on the network and without touching anything else I went straight into a demo view that I had used to isolate the problem (the view mention in the original initial post). I was now able to save the template without > being saved as & gt; withing twig brackets.

    I was administrator before, super admin after. Seems like a bug for multisite only perhaps.

    in reply to: Views is broken #39477
    badabingbredabadabingbreda
    Participant

    Thanks for your reply. I have yet to hear back from my client. I asked him to create a staging copy of the site. I there disabled all plugins that I could but that didn't help. Something that didn't seem of importance was that it's a multisite environment. I asked him to assign me the role of super admin. After he did so, the problem went away.

    This was Friday morning, I reported to the client about my findings but he has not replied yet. I mean to test the theory and have him strip away the extra privileges on staging, and grant me them on live. Was going to report back as soon as I knew more, but it's undetermined when that will be.

    in reply to: Views is broken #39445
    badabingbredabadabingbreda
    Participant

    That's just it, it's on a live site. It just started happening after I was informed that a Twig template wasn't rendering, but I'm unable to edit it and troubleshoot because of this.

    Here's what happens when I save a view (this isn't the view that's not working, but if I edit that one it will just mess it up more than it already is):

    https://www.loom.com/share/487526fac3314bc098517f403ef910c6

    in reply to: Setting Render Options to PHP for Block #20706
    badabingbredabadabingbreda
    Participant

    LOL, double slashes were automatically removed in my post. They were there where I mentioned them, I swear!

    in reply to: Code generated broken? #20698
    badabingbredabadabingbreda
    Participant

    Thanks for the quick update, that worked!

    in reply to: Code generated broken? #20671
    badabingbredabadabingbreda
    Participant

    That does seem to work for now, thanks.

    in reply to: MB generated blocks in Views #20655
    badabingbredabadabingbreda
    Participant

    I think you meant to say MB AIO v.1.11.14

    in reply to: Custom Field that works with MB_Relationships API #20626
    badabingbredabadabingbreda
    Participant

    Okay, so maybe one or two more things:

    You've been very helpful with other extensions already so maybe you are willing to a add two action hooks, one for MBR_Relationship::add() and one for MBR_Relationship::delete() ?

    I see a situation that one might want to update a custom field to keep track of the total number of relations for a relationship id. Because changes can me made from both ends an action might be a better fit to do that once, so that it can easily be displayed without the constant overhead of counting the rows in wp_mb_relationships table at runtime.

    Another use for it would be to clear the cache on the post for which the relation has just been added or deleted. I don't think that's currently possible, since it doesn't keep track of changes.

    in reply to: Custom Field that works with MB_Relationships API #20622
    badabingbredabadabingbreda
    Participant

    Okay, so thanks Anh for helping me out. I made this into a plugin available for download.

    Needs Meta Box and MB Relationships extension obviously; The plugin/field is NOT a replacement of the Relationships Field, but can be used to control multiple relationships like the one described in the repo's README.

    https://github.com/badabingbreda/mb-field-multirelationship

    in reply to: Custom Field that works with MB_Relationships API #20619
    badabingbredabadabingbreda
    Participant

    LOL, if only you had chipped in earlier... It does seem to work! Thanks for that!

    Great, now I can remove all my workarounds that do the important stuff that doesn't work when you don't register the metabox, namely adding, deleting and getting the connections... 🙂

    Hopefully my last question:
    Now that I have no use for the meta boxes but CAN use the relationships, is there a way to hide the meta boxes using a parameter while registering the relationship by any chance? I tried using the show/hide extension, targeting a input_value but to no avail. Currently writing CSS that echos with the field that hides them, but maybe there's already something for that.

    in reply to: Custom Field that works with MB_Relationships API #20604
    badabingbredabadabingbreda
    Participant

    I continued on my quest to make it work. I managed to find a way to get most things to work as I wanted it, but I'm still hitting a bit of a snag.

    Please review my video first to see that it works.
    https://www.loom.com/share/57850d8cbe524626bcf4431f6f6dbc3f

    The MB_Relationship_API::register() command is there, but in order to make it stop registering it whenever I'm on admin and in the post_type 'attendance'. That way the metaboxes don't show up and don't save, thereby not interfering with my coded API::add() and API::delete()

    I do that by checking for is_admin() and get_post_type( $_GET['post'] ) == 'attendance' in the mb_relationships_init action-hook. If both true, the script bails early, thereby not registering the relationships.

    However, it currently only works on a UPDATE-action on the post. On the initial CREATE of a new attendance-post it doesn't seem to work. My guess is that the relationship IS registered (doesn't bail early) and overwrites my coded relationships.

    Any ideas to make this final piece of the puzzel? I have all the goodies from MB Relationships API, but need a way to block the relationships from overwriting my code when editing a post.

    in reply to: Custom Field that works with MB_Relationships API #20598
    badabingbredabadabingbreda
    Participant

    Thanks for that video, but it illustrates exactly what is not supposed to happen. You were able to set John as both absent and present.

    in reply to: Block doesn't receive unique ID when duplicated #20489
    badabingbredabadabingbreda
    Participant

    Yes, I know that works. What I meant was that when you DUPLICATE an existing block it doesn't get a unique id.

    In case you would have settings that generate some inline-css that style the block. You would need the block id to target it. The whole idea behind ids is that they should be unique.

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