Forum Replies Created
-
AuthorPosts
-
JasonKeymasterHi @jimdonoho!
Can you please specify which directory each of these files are in?
Also, what specifically is the problem? Are the tabs showing up with no content in them? Are the tabs not showing up at all? Something else?
JasonKeymasterInteresting, so it sounds like the old relationship meta wasn’t clearing for some reason. It’s possible that a relationship was formed somewhere during development and the query was later changed so the field wasn’t aware of a previous relationship to remove. I’d try removing all the relationship meta for the store and seeing if the problem persists when I relate the the two again and then change it.
The primary reason you’d want to use a relationship, as opposed to just a standard meta field, is if you want the relationship to be bi-directional. In this case if you want to be able to pull up a product’s location as well as pull up a location’s products, then a relationship is the way to go. If you only want to pull up a product’s location and that’s it, then a normal field should work just fine.
Hope this helps! 🙂
JasonKeymasterHi @rick!
Interesting. So just to clear things up, every relationship in Piklist has an owner and an owned object. In this case the owner is the product and the owned object is the store. Therefore, by default, the id of the product would be stored under the store’s meta (in the wp_postmeta table) as key
__post_relate.It sounds like the
__post_relatevalue is still the old product id in the database? If you manually change it to the new id does that fix it? What happens if you remove the row altogether and reassign the store from scratch?Let’s see if we can figure this out. 🙂
JasonKeymasterInteresting. Unfortunately I’m not able to reproduce it and I’ve never heard of that issue. I really wonder if something got cached locally for you. If you’re ever able to reproduce it please let us know and we’ll be happy to look into it! 🙂
JasonKeymasterHello again!
Umm… That’s a new one to me. I just tried dragging around a metabox on a page to the side, top, etc., but didn’t have any issue occur. I’m also using PHP 7 (as you mentioned in the other thread).
Just to check the most obvious thing first: If you go up to “Screen Options” at the top of the page, is the metabox showing up there and is it checked?
September 21, 2016 at 11:33 am in reply to: error when replacing editor and specifying scope as post #7366
JasonKeymasterGreat! Glad to help!
September 20, 2016 at 6:47 pm in reply to: error when replacing editor and specifying scope as post #7359
JasonKeymasterGotcha. I actually just fixed this today which will be included in the next release. PHP 7 changed the order in which nested variables are evaluated. To tie you over until the next release, go to that file and change the culprit line from
array_push($return, $object->$field['field'] ? $object->$field['field'] : $field['value']);
to this
array_push($return, $object->{$field['field']} ? $object->{$field['field']} : $field['value']);Hope this helps! 🙂
September 20, 2016 at 11:23 am in reply to: error when replacing editor and specifying scope as post #7355
JasonKeymasterHi @tirins007!
What’s the specific error, please? Thank you for providing the call stack but it helps to have the error, too. 🙂
Also, which version of PHP are you using?
Thanks!
JasonKeymasterIf you use the get_posts with the same parameters elsewhere do you get the posts? That just means something must be wrong with the query itself. Perhaps the post type is misspelled? I’d try doing the query outside of the field and see what you’re getting.
JasonKeymasterI’m not sure I follow. So it’s showing the “No Supplier” option, but not the rest of the suppliers? Are you using the latest version of Piklist?
The simple part should be getting all the suppliers to show up. If the get_posts query is correct, then they’ll show up. There must be something else going on.
JasonKeymasterHi @lalit!
I assume you’re talking about changing the
'field'and not merely the'label'.If so, then you’ll either need to change the meta_key (assuming this is a metabox) in the wp_postmeta table in the database, or make some sort of PHP function that you fire once to migrate the data over to the new field.
Hope this helps! 🙂
JasonKeymasterHi @catacaly!
Oh, wow. That’s definitely the product of looking over generations of Piklist code. Making a Piklist relate field is much, much simpler these days.
Check this out:
piklist('field', array( 'type' => 'select', 'Label' => 'Supplier', 'choices' => array('' => 'No Supplier') + piklist(get_posts(array( 'numberposts' => -1, 'post_type' => 'product_supplier' )), array('ID', 'post_title')), 'relate' => array( 'scope' => 'post' ) ));Simple as that. Grab the posts like you normally would using get_posts, then use a handy function Piklist provides to turn the results into an array where the key is the ID and the value is the post_title. You can use this with checkboxes, select fields, radios, etc.. No javascript or anything like that is necessary.
Hope this helps! 🙂
JasonKeymasterCan you please post your field here so I can take a look?
JasonKeymasterHi @catacaly!
You wouldn’t change the scope to a custom post type, as the object is a post (therefore the scope is post). If you want to relate to a custom post type, you just limit the choices to that post type.
Hope this helps! 🙂
July 17, 2016 at 9:20 pm in reply to: [functional bug] single image not working after it's removed from media #6968
JasonKeymasterHey @pionect!
Just fixed this bug. Glad to finally have it done. That bug has bit me on projects in the path, unfortunately I was always busy doing what I needed to get done and didn’t have time. Now it’s fixed!
To tie you over until the next version of Piklist is released with the fix, I’ve provided the patch for the fix. In case you don’t know, just go to the piklist directory and do
git apply file-fix.patch— assuming you’ve placed the file in the piklist directory. Otherwise you can always just read the file and apply the patch yourself. 🙂Patch: https://dl.dropboxusercontent.com/u/1392338/file-fix.patch
Hope this helps!
-
AuthorPosts