I have a site with several relationships which have been migrated to the new Types 3.0 structure. I have a one-to-many relationship between Posts and a CPT 'Communities':
https://toolset.com/wp-content/uploads/tmp/Screen_Shot_2018_05_29_at_11.25.09.png
Based on the old relationships, this has been set up with a maximum of 5 Posts assigned to each Community, but there's no need for this limit. I tried to edit the relationship:
https://toolset.com/wp-content/uploads/tmp/Screen_Shot_2018_05_29_at_11.28.37.png
I can change the number for the maximum, but there doesn't seem to be a way of removing the limit. If I delete the number from this field, it shows the placeholder "Default: No limit", but if save the relationship, this is not actually saved - the relationship still has the same maximum limit.
I can set it to an arbitrary large number as a workaround of course, but it would be good to sort this out.
Many thanks,
Chris
The legacy Toolset did not offer any limits on connected posts, hence that cannot have been created by Toolset.
By default, if you migrate a relationship it will be a One-to-many with a 1-endless amount of connections and a "Minimum limit cannot be lower than 6 because there are associations with this amount of items".
Hence, the relationship you mention must be edited or created either with a Beta version, or it was edited/created after the update.
And this is in fact what happens.
1. If you created a Relationship in past with the legacy Types,
2. And now installed/updated/migrated to 3.0
3. And then edited that default relations it created, set it to a limit, and then
4. Want to edit it again, it fails.
Otherwise, after the straight migration, the settings are 1-endless as above explained.
But as soon I edit that relation, the settings (on my end) defaulted to 6 - which is the number of maximal connections I happen to have - and it's irreversible.
I escalated this as a BUG.
Great thanks Beda. I'll look forward to a bug fix in a future release.
Best wishes,
Chris
Hi, I am sorry, neither I nor the Developers can see this issue anymore.
Would you mind to re-try to save a new value in the limit (higher than the minimum)?
It should work.
If not, please can you send us a copy of the site?
https://toolset.com/faq/provide-supporters-copy-site/
Hi Beda,
I think the issue I'm experiencing is slightly different to what you are doing. I have a migrated relationship which has been set to have a maximum of 5 Posts linked to a Community. I can edit the relationship to change that number: for example I can set a maximum of 6 Posts. That works OK.
But I can't see a way of removing the limit altogether. If I just delete the number from that field, and save the relationship, it gets set back to a limit of 5 (since in this case "Minimum limit cannot be lower than 5 because there are associations with this amount of items").
I'll send you a duplicator package of the site so you can have a look.
Thanks,
Chris
I have a migrated relationship which has been set to have a maximum of 5 Post
How?
There was no such setting in the Types before the last release.
Anyway, as stated, you cannot remove the limit as the limit will be at least as many connected posts you had in that relationship.
So the minimum will always be the maximal amount of child/parent connected posts used in one relation.
That is perfectly expected, as otherwise, you would destroy existing connections when you limit it to a lower number!
Let me know if this is unclear.
Hi Beda,
Yes, I know that this limit didn't exist in the previous version of Types.
When I migrated, some of the relationships had limits set, apparently based on the maximum number of connections in the existing parent/child associations. (See the Description field in the screenshot.) So for example in the Communities - Posts relationship, the migration process has set the maximum number of Posts per Community to 5.
I want to remove that restriction, so that I can set an unlimited number of Posts for each Community. So the description field would look like this:
Communities [0 .. 1] << Posts [*]
... but it doesn't seem to be possible to do that from the editing screen for Relationships.
Is that clear now? - sorry it's quite confusing to explain.
[I did try editing the database directly: in the 'toolset_relationships' table, setting the column 'cardinality_child_max' to '-1' removes the limit. But obviously I don't want to be hacking the database in this way on a live site!]
I've made a duplicator package for you to look at. Could you enable a private response field and I will send the link?
Thanks,
Chris
Yes, I understand.
Although, it does not happen in my install that after the migration the relation is limited.
On the contrary, it's a one to unlimited posts.
Only after editing, here, I confirm we cannot set it back to endless.
I re-escalated this.
OK, thanks Beda. I think on my migration, only certain relationships were limited after the migration - I'm not sure why.
Can you set up a private field so I can send the link to the duplicator package?
- Chris
Great.
Our developer fixed the problem and it will be shipped as soon we tested this and made it ready for your site (and other's).
I will update you here when it's ready.
That's great Beda. I'll look forward to getting the fix in due course. Many thanks for your help,
Chris
It's fixed and eventually, we will even ship an erratum, I will let you know.
Thanks Beda. Great work everyone!