Comments (7)
This might be related to some changes in the core. I'll check this issue later this week.
from subsectionmanager.
I cannot reproduce this behaviour in my current install. Could you please check the latest Subsection Manager code. Thanks!
from subsectionmanager.
Grzegorz, are you still experiencing this?
from subsectionmanager.
So far no, but tommorow I'll do some more tests.
from subsectionmanager.
This issue doesn't make sense to me. If you have only one item selected, $data
will be passed like this:
Array
(
[relation_id] => 92
)
If you have multiple items selected, $data
should look like this:
Array
(
[relation_id] => Array
(
[0] => 88
[1] => 89
)
)
In the latter case the IDs should be returned as a comma separated string which is done using this line of code:
if(is_array($data['relation_id'])) return implode(", ", $data['relation_id']);
It correctly returns this in my parameter pool:
$ds-test '92, 88, 89'
Could you please change your getParameterPoolValue()
function like so and report back what is returned when you browse to your parameter pool?
public function getParameterPoolValue($data) {
print_r($data);
if(is_array($data['relation_id'])) return implode(", ", $data['relation_id']);
return $data['relation_id'];
}
(Please don't mind the error you'll receive after the output or the print_r
function.)
from subsectionmanager.
Hi Nils, I bumped into the comma-separated list bug once again. Well, actually it behaves "correctly" as you describe above, returning:
<ds-sampler-media>
<item handle="21-11-2-4-14-26-13-23">21, 11, 2, 4, 14, 26, 13, 23</item>
</ds-sampler-media>
<ds-sampler-media-to-project-link>
<item handle="20">20</item>
</ds-sampler-media-to-project-link>
But this way Symphony only uses the first ID and ignores the rest, as you can see from the single-item result (expecting 3)
Replacing this in field.subsectionmanager.php
:
if(is_array($data['relation_id'])) {
return implode(", ", $data['relation_id']);
}
else {
return $data['relation_id'];
}
With:
return $data['relation_id'];
Makes Symphony and me happy, giving the correct result:
<ds-sampler-media>
<item handle="21">21</item>
<item handle="11">11</item>
<item handle="2">2</item>
<item handle="4">4</item>
<item handle="14">14</item>
<item handle="26">26</item>
<item handle="13">13</item>
<item handle="23">23</item>
</ds-sampler-media>
<ds-sampler-media-to-project-link>
<item handle="20">20</item>
<item handle="20">20</item>
<item handle="20">20</item>
<item handle="6">6</item>
<item handle="6">6</item>
<item handle="6">6</item>
<item handle="5">5</item>
<item handle="5">5</item>
</ds-sampler-media-to-project-link>
May ask why you are imploding that into a comma-separated list that doesn't seem to be working? Thanks for this extension anyway, I still don't understand why it isn't already in the default Symphony distribution.
from subsectionmanager.
May ask why you are imploding that into a comma-separated list that doesn't seem to be working?
The problem is that parameters don't allow multiple item thus the need to join all items in comma separated list. Symphony 2.2 introduced the output of parameters in the XML but for data source filtering you still need the parameter.
In your case: Take your data source and let it output $ds-sampler-media
with a comma-separated list of ids. Use this parameter as filter in another data source to get your desired output.
This is a Symphony limitation.
from subsectionmanager.
Related Issues (20)
- Not allow multiple is broken
- Firing search only if searched string is greather than one HOT 2
- Invalid argument supplied for foreach() HOT 2
- Height miscalculation HOT 30
- Layout problem with new items HOT 4
- Version 3.5.1 still contains few references to _subsectiontabs HOT 6
- Error when used with sections_event HOT 4
- SubsectionManager timing out in large Section HOT 6
- Subsection Manager causes an error with Elastic Search extension... HOT 1
- Subsection manager isn't populating relations when loaded by reflection field
- Add new button lost after upgrading to Symphony 2.3.4 + Subsectionmanager 3.5 HOT 4
- Add item iframe is too small, misses scrollbar and add button HOT 3
- Can’t Update from 3.0b3 to 3.5.1
- #drawer-documenter
- Fatal Error when attempting to update datasource HOT 6
- Displays ALL possible entries when error is thrown on subentry creation or when trying to drag a newly created subentry before saving the main entry HOT 2
- Upgrading from 1.2 to 3.5.1 gives mysql error[1146] HOT 4
- Will there be an update for Symphony 2.4? HOT 5
- »Allow multiple entries« is not honored
- UI Issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from subsectionmanager.