Comments (22)
This should work, no problem. On these lines, replace IDs in SBLs and only then commit entries. Sections Event updates Reflection fields.
Is this a bug in latest version?
from sections_event.
Yes, as far as I can tell the reflections aren't being updated after SBL (need to go back and save again)
from sections_event.
It also looks like editing entries does not force reflection fields to update.
from sections_event.
Aaaaa, I know this! :)
In order to be updated, the Reflection field needs to be triggered, included in the form.
In your case, the Reflection (settings
or what's the name) uses published
, images attached
and gender
. Make sure that whenever you change any of these, you include the Reflection as well.
<input name="sections[orders][settings]" value="" type="hidden"/>
Another thing on Reflection. Even if you update the value for one used field, do supply the values for all used fields because settings
needs the values from all three in order to process correctly.
from sections_event.
That fixed the problem with editing entries!
But the problem with SBL linked entries still exists. Reflection still seems to be running before the SBL field is updated.
from sections_event.
So, if you supply a form with these values:
<input name="sections[orders][settings]" value="" type="hidden"/>
<input name="sections[orders][published]" value="yes" type="hidden"/>
<input name="sections[orders][images][]" value="483" type="hidden"/>
<input name="sections[orders][images][]" value="297" type="hidden"/>
<input name="sections[orders][gender]" value="Male" type="hidden"/>
You say that settings
will have incorrect values?
Please supply a working example of your use case and a not working example (in the same fashion above).
from sections_event.
K. I found the problem. A fix is on the way.
from sections_event.
Fixed in this commit.
The order in which sections are executed is important for Entries with Reflection field.
In your case, you have an Images
section and an Orders
section (don't know the name, using this one). Since the Reflection field in Orders
section uses the SBL field that points to Images
section, Images
must be saved first, and then the Order
, so Order Entry has titles from Images.
In your form, use the __order
key to specify the order of sections:
<input name="sections[__order]" type="hidden" value="images,orders" />
from sections_event.
Thanks so much, Vlad. Sorry that I’m so slow! Will try this out today :)
from sections_event.
Unfortunately, it doesn’t seem like this works. (I used that exact input.) To be specific, the reflection field is being updated correctly when entries are edited. However, when new entries are created, the SBL field is still ignored.
from sections_event.
:| weird. It's working fine for me. I was in same situation yesterday and the patch fixed it ...
What are the names of your sections? Images
and ...
?
from sections_event.
It’s images
and listings
. In listings
, the reflection field is called sort-key
and the SBL is called images
. sort-key
is only getting the right SBL values after editing through front end with sections_event OR resaved through the Symphony admin.
from sections_event.
So if you send this in the form it still doesn't work?
<input name="sections[__order]" type="hidden" value="images,listings" />
What's the result from print_r($sections_input)
on line 82?
What's the result from print_r($_REQUEST)
as well?
Let's make sure the order is correct.
from sections_event.
$sections_input
@ line 82
[redacted]
from sections_event.
Well, hello problem. It seems the order isn't computed as it should.
Please replace these lines with these:
print_r($sections_input);
$order = null;
if( isset($sections_input['__order']) && is_string($sections_input['__order']) ){
$order = array_filter(explode(',', $sections_input['__order']));
unset($sections_input['__order']);
}
if( is_array($order) ){
$sections_input = array_merge(array_flip($order), $sections_input);
}
print_r($sections_input);die;
And show me the output.
Thanks.
from sections_event.
Here you go
[redacted]
from sections_event.
This may also be related, but the reflection field doesn’t update correctly. I have a field that calculates a duration from the date/time field and then multiplies by a number field. When editing entries (changing the number and dates), the reflection field changes based on the new number but not the duration.
from sections_event.
(Saving in the Symphony admin works perfectly.)
from sections_event.
You can safely remove the print_r(...)
instructions from my previous comment.
Everything seems to be fine, from Sections Event point of view. The order of of keys in processed array is images
, listings
, which is correct.
I think there is another issue here. I recommend you debug this step by step and see where the other problem is.
from sections_event.
@vlad-ghita - It works now, but it’s because your previous comment also changed the code. I’m guessing it’s the array_flip($order)
. Can you commit this change to the repo?
from sections_event.
Yeah, I wanted to commit it, but was waiting for positive feedback :)
from sections_event.
Awesome!
from sections_event.
Related Issues (15)
- Event filter support HOT 7
- Problems when saving special characters HOT 6
- Inserting POST values with an event before Sections Event HOT 3
- Different filters on different sections? HOT 5
- Sections Event and latest members not working HOT 4
- Sections Event without Members extension? HOT 3
- Errors with 1.4 HOT 7
- Unable to get multiple ids in a SBL field HOT 5
- Weird validation errors HOT 2
- Same problem again as issue #2 with latest update HOT 5
- Feature request: custom validation messages HOT 2
- Files not uploading once again HOT 1
- Validation for multiple sections doesn't work HOT 5
- Suggest Feature: Something similar to Fingerprint extension HOT 2
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 sections_event.