Mateo, could you give us a brief run down on how relations work?
All I'm getting is errors.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Clip Relations
-
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: May 31, 2010
- Posts: 404
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Ok
I've just pushed a fix because I saw that after the creation of the relation, the form didn't redirect where it was supposed to. Anyways, I've implemented a parameter to update the tables in the next pageload.
Try it again,
when you setup a relation the table needs to be "refreshed", but that cannot be done in the same pageload because the class is already defined, so, in the next pageload the Doctrine Model is updated considering the new relation, and Clip needs to order the table update too, but that last step didn't happen.
Try now
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Side note:
I can't avoid to speak like a geek with you Darryl.
I (really) like your sarcarms and off course, your feedback,
so, let's take my techy words as a friendly sarcasm too
Syntesis:
The DB table updates weren't updated after the creation
I guess it's solved now
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Softmore
- Registered: Feb 07, 2003
- Last visit: May 31, 2010
- Posts: 404
If you have a minute, can you give a quick run though on creating a relation between two publication types? There was a few things that I didn't quite grok. -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Ok, I'm back after 18 hours without energy
nothing to do with epic storms...
So, in the relations form I've tried to use the semantical sense of the relation,
because that helps to define the side where the relation field is added too.
Let's suppose that we have a couple of pubtypes: Events and Photos.
We want to relate them to use one Photo on an Event.
Events Photos
Then, we have two choices:
If we want that each Photo be used only ONCE, we need a one-to-one relation. If we want to reuse Photos between Events we need a many-to-one (this one allows many Events per Photo).
So, you setup the relation as:
One Event has One Photo (one-to-one) or
Many Event has One Photo.
Being Events the owning side.
The next step is simply assign the alias you want to use for the pubfield:
Event.photo and Photo.event(s) for instance.
So, Alias1 is "photo"
and Alias2 "event", or "events" if it's many-to-one.
You will see the use of the alias in the display template, as $pubdata.photo i.e.
Note that all is embedded now in the $pubdata array, no more sparced vars on the display template.
Later I'll add some config options for the relations.
I hope to be clear, additional doubts and feedback are welcome
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Softmore
- Registered: May 10, 2010
- Last visit: May 18, 2010
- Posts: 165
Color me confused. I setup an Event pubtype, then a Photo pubtype. Then I setup the relation with one Event to many Photo; I set Alias 1 to "photos" and Alias 2 to "event". Then I created an event publication without setting anything in the photos relation field in the form. Then I create a photo pubtype and set the relation field to the title of event publication I created previously. I saved the form, but the relation setting did not stick and I haven't a clue if I even did it right.
--
-
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Uhm
seems that the new Ajax Workflow broke the autocompleter, I have issues too, and I'm syncing the code to the recent changes in the core. Hope to get it fixed ASAP
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
Ok
I got it, please get the latest GIT code to be able to work with the latest Core's code.
--
- Mateo T. -
Mis principios... son mis fines
- Moderated by:
- Support
