[Bug?] Express Entries can only see Associations in one direction, maybe?

Okay so I’m trying to use Express in rather complex ways, and right now I’m tripping up. I’ve tested the issue with the “Express Entity” (single) Attribute type, and "Express Multiple (experimental, multi-select) Attribute type, the issue appears to manifest in both regards, so I don’t think this is related to the experimental code I’m using for Express Multi-Select (the code provided by hissy).

The issue is related to two different Express Objects, their associations and Express Entries for each and how they see such things.

I have two example Express Objects, “Event Registration Entries” and “Games”.

Games, as an Express Object. When you create Entries for this Express Object, the Entries represent “Games” that can be selected by other Express Objects throughout the site. For example, I’ve added “Counter-Strike: Global Offensive”, and I want to use this for things like “Which Game for this Tournament”, “Game Preference” and all sorts of things.

Event Registration Entries, as an Express Object. When you create Entries for this Express Object, the Entries represent the singular registration of a human to an event, and it is expected that only one registration Express Entry will exist per human (let’s assume this is true, this isn’t about validation logic at this time). When a human Registers for an Event, they are in-effect creating one of these Experss Entries. One of the “questions” the human is asked is “Which Games do you want to play?”, and they are given the option to select multiple “Games” (as in, the Express Entries for the Games Express Object through the Association).

Naturally, I’m working on making an Express List Block show all the Games that people want to play for a specific event (namely, the one you’re looking at).

When I use an Express List Block that shows “Event Registration Entries”, each Express Entry shows the games each human picked.

When I use an Express List Block that shows “Games”, but I adjust it to show which “Author”/human/user picked a game, for any “Event Registration Entry”, it is blank. It appears to not be able to see that any Game has been selected for an “Event Registration Entry”, and this is where it breaks down.

Again, I have tried to replicate this issue when using Single-Select (Express Entry) or Multi-Select, from the perspective of the “Event Registration Entry”, and there results don’t change. The “Games” Express List Block cannot seem to see which other Express Entries have picked A Game, or Any Game.

The Associations are Many to Many, and I’ve tried toggling the Ownership options, no change there.

I’m rather out of ideas, so to me this sure looks like a bug.

I’m on Concrete v8.5.4, and the Express List Blocks are tested against my custom Template, as well as the stock Template. I’ve tried lots of other things too that I can’t remember.

Please help! I really hope we can figure some way to do this :frowning:

Anyone?

20char20char

Ahem custom BLOCK template and stock BLOCK template, not page/website template. Since I cannot edit my original post, clarifying here…

Yeah I really do need help figuring this out as this is not an expected outcome at all, and tangibly is going to limit what we can do in ways that are very concerning! Can anyone from the dev team chime in here please?

Am I posting in the wrong section maybe?

@BloodyIron I think, very simply, that nobody has a readily available answer to your question and it looks like the kind of thing that would require some serious digging to answer.
Did you try on Slack?

Does that have to be Express? Would you consider Doctrine instead? I find annotations are much easier to deal with.

Since the IRC/Slack bridge broke I haven’t jumped on as I use Element. Really hoping to not have to use yet-another-chat-program in this case. :confused: Any chance for a bridge to Matrix perhaps? :stuck_out_tongue: Also, um, isn’t that what this forum is for?

That being said, yeah I totally understand there may not be a ready answer for this. I just wasn’t sure if anyone had noticed the post that was in a position to help me. I fully accept this is a bit of a doosie. I hope we can get it sorted!

We are far too deep to switch how we do our data structure. Express is supposed to be able to do this stuff, as it was “advertised” (so to say), so that’s why we’ve designed around it. So yes, it does have to be Express.

Yeah I still need help with this please :frowning: I’m stuck in the mud until I can get this figured out.

You are not alone! I’ve seen this issue when using “Express in rather complex way” a few times.

I’m sorry I forget exactly what triggers the issue and how to fix it. However, if memory serves it has to do with the internal cache getting out of sync while creating entries and/or changing associations. I think you may have to clear out all your data and re-create / re-import. Then whenever you update data or association use Express::refresh() on each object before doing the next data update.

I wish I could be more specific but that’s all I can remember without digging into my code.

@JeffPaetkau I really haven’t done much of any real customisation just yet, beyond getting an image type to show the image instead of URL for it. So, this sounds like a bug that shouldn’t be addressed by overhauling every Express block I could ever work with to force “Express::refresh()” or wipe and re-build all the data. That doesn’t fly for production.

So, perhaps instead, if you could post all that you remember on this scenario in the bug-ish report I have already, that’d be great, as I think this should probably get comprehensively addressed by the devs, if it is as you describe : [Bug?] Express Entries can only see Associations in one direction, maybe? · Issue #9709 · concrete5/concrete5 · GitHub

If you get a chance to add further detail, that’d be appreciated :slight_smile: (probably best we start treating this like a bug now then).

Ya, there is for sure a bug there. At one point I was going to create a simple reproducible example and report it. However, I was neck deep in a big project and never got around to it. I’d love to help if I could but I’m afraid I’m still neck deep in work. First task is to see if you can create a simple reproducible example. No one will be able to make any progress until that is done.

So, do we have to be on slack to get help with this? Or can we get help from these forums or the github bug report? 30 days stuck in the mud now :frowning:

The reason you are not getting a solution from the community is not because members don’t want to help. it is because no one knows of a solution to your problem.

I’m really not seeing how to join slack with my own E-Mail address. When I go to create account it limits me to domains that I don’t own (portland labs, etc). So, I’m dead in the water there it seems. Rather big bummer that the IRC aspect broke down as that worked rather well for a while.

I really don’t know what to do here to get help with this. What do you recommend @mnakalay ?

Also, I checked the locks in the concrete dashboard and didn’t really see anything relevant to a failure of any kind. Unsure if there’s other logs I can check.

Thank you for being thorough in your post about the problem. At first I was a little worried I wouldn’t be able to get a full picture of what you’re experiencing, but when I just sat down and made the time to read through the issue I think I got it pretty quickly. (Emphasis on “think” ! :sweat_smile: )

I think I know what the issue is, or at least something that’s contributing. I think your reliance on the “Express Entity” custom attribute type is tripping you up. To be very clear: you should not need to use this attribute type at all in order to build complex Express-based applications. The Express Entity custom attribute type is really just for joining non-Express objects like Pages, Users, etc… to a particular express object, in a one-off and non-associated way.

For example, let’s say you’ve got a custom page on your site for these game objects that you’ve created. You’re making custom content pages on your site, and you want to use custom code on those pages to pull data from the game express objects. You’d create a new page attribute with the handle “page_game”, and it would be of the Express Entity type. You’d set a particular game against a particular page, and then use custom code to check to see if that attribute was set on a particular page, and if so you’d retrieve data from it. So you’re only going in one direction – from the page, to a particular game object. Additionally, this does not create an association of any kind. The express object has no knowledge of any objects – Express or otherwise – that are referencing it via the express entity custom attribute type.

To be honest, this post is underscoring just how problematic it is that we list every single attribute type in the Express section, when creating attributes for Express objects. I know why we did it – we didn’t want to have to mess around creating a UI for selecting which attribute types were valid for which Express objects. But the Express Entity attribute type should almost never be used for Express objects, because it’s creating this confusing situation where you think you’re creating an association between two Express objects, and in fact you’re not.

What you should be doing instead is this: 1. Do not use the Express Entity attribute type ever when working with Express objects. Save it for objects that implement attributes that are not themselves Expres objects – like pages, users, etc… 2. Instead, use Associations between your Express objects. It sounds like you’re creating associations to some degree, since you mention “Many to Many” – but sounds like you’re using the Express Entity attribute type in order to place the form control on the form, maybe? That’s not how it works. Instead, you should create the association, and then use the Association tab in the form control dialog box to place the association control, instead of using the Express Entity attribute type control.

Here’s me setting up the many to many between the two objects:

Here’s what that dialog box looks like if I set up Games to Event Registration Entries many to many on my local site, and add a “Game” selector to my “Event Registration Entries” form:

I hope this helps, and gets you back on track.

3 Likes

Thanks @aembler !

First, I’ll fully admit I may not actually be correctly understanding Express, so I’m going to give additional insight into what I’m trying to functionally achieve.

Second, you may be onto something here, but I’m not yet sure.

Third, please forgive me if I use incorrect terminology at times, this certainly is complicated to represent.

The plan I have is to have a whole lot of Express Objects and have them all work together to store data, have that data retrievable in useful ways to users, and make it somewhat interactive, so to say. From what I have seen, I do think Express can do this, but I could be incorrect.

For the “Games” Express Object (whereby each Express Entry represents a different Game), I do not want to have a page for each Express Entry, in this case. I want this to be a set of Express Entries that many other Express Objects can interact with in interesting and useful ways. As for the example, when a user registers for an event with the Express Object for registrations, I want them to be able to “pick” which games they think they want to play at that event. Hence, I want them to “associate” one or multiple “Games” with each “event registration entry”, or at least something of similar functional regard. That way, when I use an Express List Block, I can list the Games, filtered by the Event (the page the block is on, based on another Express Object for “Events” whereby the page represents the Entry for “that event”) and shows which people that have registered, chose which games (a list of game preferences if you will, for that event, and who picked what).

This is just one example, and I have a very long list of other ways I want Express Objects and other Express data to work together. A lot of the time I don’t want pages per-Express Entry, but instead there are going to be pages I want to build with Express List Blocks, probably Express Detail Blocks, that pull from a single, or multiple, Express Objects and/or Express Entries, to build a page out with complex data that’s useful to the user.

For example, a page to manage a team, for a tournament, at an event, whereby the user that created the team, can invite/approve/reject people joining the team (I already have a conceptual design for this workflow).

So… I guess the real question is… what am I doing wrong, and how do I achieve this with Express? What draws me to Express is that I can abstract away the DBA aspects here and interact with Express data in convenient ways (even though I’m already writing custom templates to go deeper).

I hope that clarifies, and I certainly have been trying really hard to write effectively to convey what I am trying to do here, not just in this post, but in earlier. That way I can get accurate help. :slight_smile:

I hope I can get a response from you on this matter sooner @aembler as I really do need to sort this out and get back in the right direction, even if that’s a completely different direction. Thanks for your help!

Yeah I wanted to add, I have like 20-30 (don’t have exact count this moment) Express Objects defined, all working together for a big picture massive set of functions. So I really do want to find a solution for this as I have been unable to move forward since I found this issue.

To add some more detail and examples…

I have an Express Object whereby each Express Entry is an event (think like, an event you get tickets for), with things like location, date, etc. It is associated with a bunch of other Express Objects so that when I “create” the Event Entry I can select from a bunch of other Express Entries in other Express Objects through associations. For example, picking which location the event will be at.

Then, once the “Event” is made, I plan to have a website page (within Concrete CMS) actually displaying lots of info for the event from that Express Entry, and other Express Objects too. Combinations of Express List Blocks, Express Detail Blocks and other such things. So generally no single page for each Express Entry in any of the Express Objects (although there may be some exceptions in some cases).

Then, once the “Event” is open (to registration, etc), there’s an Express Object, “Event Registration”, which I mentioned earlier, whereby each Express Entry for it represents a person “Registering” for an event (this is separate from Ticket ownership, etc). When the person “Registers” for an event, they select which Event, through the association with the Express Object for “Events”. As well as selecting which Games they want to play through the association with the “Games” Express Object (by picking which “Games” Express Entries they are interested in).

This is just a bit of a short example of what I’m trying to accomplish here. I have so many other Express Objects with many different kinds of associations with the intent of “selecting” things in many different ways when creating Entries. But also in some cases those Entries becoming selections for other Express Objects through Associations.

For multiple years now I’ve been under the impression this should be achievable, and all evidence I’ve seen, all study I’ve done on this technology, supports this (so far as I can tell). And the area I’m stuck in right now is viewing just one of those associations and selections from a specific perspective. I really don’t think I’m trying to do this wrong, but I also don’t know why it isn’t working.

I need your help, please. I’ve been stuck since Aug 8, and I do believe I’ve exhausted all avenues I know of to help myself on this matter.