3 users online. Create an account or sign in to join them.Users
Data source dependencies
This is an open discussion with 3 replies, filed under General.
Search
There are two ways:
I believe DSs are ordered by dependencies, and the leftovers (without dependencies) are executed alphabetically. This is in part due to how they are stored in the database (since the DS Editor provides an alphabetical list in the UI, they are stored in the DB in this order too). Therefore try naming your DS “Z My Data Source” to force it to the bottom.
The proper way is to use the dependency array stored in each DS. This is an array of strings in the form $ds-my-datasourcename, which are the names of Output Parameters. To get this working, I found I had to ensure the following:
- that I had set the
$dsParamROOTELEMENTstring for my DS (e.g.nicks-datasource) - anything that it adds to the param pool that I want other DSs to be dependent upon should be named accordingly (
$param_pool['ds-nicks-datasource']) - use this parameter in another DS as a filter
This was the sticking point when I tried implementing multiple output params from Data Sources. Getting a DS to output multiple params into the pool was simple. But for dependency ordering to be honoured the output param name needed to be in the form: 'ds' . this->$dsParamROOTELEMENT.
I believe Alistair wanted to get multiple output params working for 2.1, so the logic that figures out dependencies would need to be rewritten. I’m guessing when it was written initially it was never considered that you may want to customise a DS to the point that it adds new params to the pool, so it’s hard-coded to look for params starting with ds-.
Hope that points you in the right direction…
Ah, I see. I missed the need of the ds- prefix. I’ll will try it and report back.
Adding the $dsParamROOTELEMENT string and setting the prefix ds- works great.
Thanks for the tip, Nick.
Create an account or sign in to comment.
I have a custom data source that returns the name of the current author to the parameter pool, e. g.
$context= “Nils”.Now I have another standard data source containing articles that should be filtered by this author name, but my custom data source seems to be executed after the execution of the standard one.
Does anybody know how to correctly set the dependencies between and the order of data sources?
Thanks for your help!