-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple datasource parameters #728
Comments
For the record, I added this many moons ago to a 2.0.3 (or so) version. Happy to pass on the code if I can find it. Worked as expected EXCEPT for dependency/ordering resolution which, at the time, relied upon output parameter names to be in the form This would be the awesomes. |
Definitely would be helpful! |
I also wrote extension lately that allows to output additional parameters from the XML that was generated. Very useful when using dynamic XML data-sources, but also in other situations. |
Can you open a separate issue for that @ahwayakchih? I'd like to look at including it, there has been a number of times where that functionality would of been incredibly useful. |
Sure i can and will, but it's important to note here, that i also hit the same problem that nickdunn hit. To keep order of data-sources i have to use So: it would be great if core did not depend on a parameter being single value (dsParamPARAMOUTPUT could be associative array) and if it could check list of output parameters to get list of parameter names that will be created, instead of checking for hardcoded, single |
Yep, that's one potential solution. |
Just an update. I've implemented multiple parameters whilst maintaining backwards compatibility. Currently parameters are set as Now the conundrum is that while keeping What I'm thinking of doing is mirroring I'll push this code as soon as 2.2.3 is out (integration is dedicated to that at the moment) |
Why not make data-sources list parameters they output? It would stay backwards compatible and at the same time it would not need to depend on field-handle (it still could, but it would not be required). AFAIK there's only one place in Symphony that would have to be changed, and it could simply check if |
Datasources already do list parameters :) |
dsParamOUTPUT is not an array. It could be an associative array, where keys are parameter names and values are field names or whatever else extensions put there (BTW it would be great if pre-save delegate was called on data-source before its code and things like EXTRAS are parsed, so extensions can add/change things easy way, instead of re-writing PHP :). Code that reorders data-sources could then check all parameter names. There would be no need for hardcoded name-checks. |
Hm, we might be misunderstanding each other, As for the delegate, does
Not sure what you mean here, could you explain in a different way? |
Nice :).
I had to tokenize PHP to inject own code there :).
Symphony code assumes that there is always So, a separate list similar to the list of data-source dependencies, or |
While this makes sense now, it will be confusing in the XML output list of params. You would get the value repeated in the XML under two different names, I presume? |
Yeah unfortunately it will. We could prevent this from happening though if necessary :) You could pull in my fork above to test this out now, I'm currently using this in a personal project so it's a getting a bit thorough workout :D |
I've pulled this into integration now. I'd say it's pretty reliable at the moment, (as in, it's been working in a side project for two weeks reliably), but it would be still good to get feedback. I haven't yet made any amends for the 'mirroring' just yet. |
That would be where @eKoeS and @nilshoerrmann step in and make things sexy :) |
We'll take a look at it :) |
[Assigned to myself so that I remember about this] |
I'm not sure the backend is the right place for that. It's pretty difficult to explain in a few lines which is the value of
Any ideas for a better phrase? |
The problem here is that, in order to generate a valid handle, we should either have a JS-equivalent of transliterations or make an AJAX request for each |
I should point out that it's more like
That sounds like it could be useful in other areas as well! I think using |
We shouldn't use an AJAX request on keypress. That might result in a really huge ammount of requests. |
I think |
Yep, that was the point :) |
So, if I understood it correctly: AJAX request on |
Yeah, although it doesn't need to be AJAX, it's just taking the value of that field and replacing the |
Okay, I got lost :) Are we talking about the datasource handle or the field handle? I thought Rowan was referring to the first, which is why I mentioned AJAX et al. |
It's the datasource handle. Rowan had a typo. From above:
Parameters will be named |
Right, but in this case we either make an AJAX request to generate the handle or we re-implement the Concerning parameters, my suggestion is to have them displayed as a list. What do you think? |
Is probably the best way, then we only have to maintain one handle function.
I like the S3 behaviour here. The actual option labels update from |
What if the user selects more than one field as parameter? |
Ah, sorry! I was talking about the help text. This explains why I couldn't get the whole point of this discussion. :) Now, bed time. Will let you know how it goes. |
The screenshots were from S3 :) |
Aha, that makes a lot more sense. In this case I'd like to suggest to use that layout for S2 as well. We don't need that explaining copy and we can just label the select box "Parameter Output" (which would correspond nicely with the right column). |
At the moment datasources can only output a single parameter and while you can add additional parameters by customising the datasource (or worse creating another), it's not efficient and really should be out of the box
The text was updated successfully, but these errors were encountered: