symphonists / subsectionmanager

Subsection management for Symphony.
Other
44 stars 32 forks source link

Captions #149

Closed nilshoerrmann closed 13 years ago

nilshoerrmann commented 13 years ago

I've just updated to the latest development version and I'm having problems with captions. I've got this setup:

{$typ}: {$vorwahl}/{$nummer}

The first two are replaced correctly, the third not. This last field is a special field type (Telefonnummer).

It worked before – is there anything that needs adjustment on my side?

nilshoerrmann commented 13 years ago

It also happens on another SSM:

{$start}–{$ende}

Both fields are simple input fields and it seems like SSM recognizes the token correctly but doesn't replace the value correctly.

ahwayakchih commented 13 years ago

Those are fields of target subsection, right?

I can guess only one possible common property there: text formatter. Are those input fields formatted? Telefonnummer does not look like it is a field type, only a text formatter. Am i correct?

nilshoerrmann commented 13 years ago

Yes, sorry, of course it's a text formatter (got confused myself).

ahwayakchih commented 13 years ago

recognizes the token correctly but doesn't replace the value correctly.

Does that mean that token is left as it is, or simply removed from result string (without adding any value in place)?

Do those fields have value set, or are their values empty?

ahwayakchih commented 13 years ago

Also, could you paste both caption and data drop settings? Are there any unicode characters there (sorry that i ask so many questions, but it is kinda hard to guess what could go wrong :)?

ahwayakchih commented 13 years ago

I just tested it here, on our internal "ToDo" section, where each entry has SSM field called "depends on", that points to "ToDo" section:

{$done}: {$task} {$minutes-spent}

$done is a checkbox, two other fields are text input fields (Symphony's default fields). It worked OK.

Are your fields text input or text area? Or something else (we use mostly Text Box fields here, and they seem to work OK too. Same for Reflection fields).

ahwayakchih commented 13 years ago

It also worked with:

{$done}: {$task} - {$more-info}

$more-info is a Text Box field with chained text formatter (custom regex rules, markdown, etc...).

nilshoerrmann commented 13 years ago

Okay, here we go with some additional information:

Both SSM fields have only a caption specified (droptext is left empty). They are set to:

Nested subsection are set to ignore.

First SSM field

{$typ}: {$vorwahl}/{$nummer}

Second SSM field

{$start}–{$ende}
nilshoerrmann commented 13 years ago

Okay, it has to do with the field position in the section: When I added another field (it doesn't matter of which type) as the last field of the section, the captions displays as expected (the newly added field is not part of the caption). Moving one of the caption fields to the bottom of the section removes it from the caption display again.

ahwayakchih commented 13 years ago

Good info, thanks for debugging that!

So your $start field token was correctly replaced, only $ende was not? Or did both fail to be replaced with correct values?

nilshoerrmann commented 13 years ago

yes, only $ende was left empty – and only if it was the last field in a section.

nilshoerrmann commented 13 years ago

Expected result:

Given result:

ahwayakchih commented 13 years ago

OK, thanks for debugging :). I found the reason. Looks like it is not a good idea to use array value pointers and unset array values in the same foreach loop. Sorry for that.

ahwayakchih commented 13 years ago

GitHub closes issues automatically, so please reopen if my patch did not help (i tested it here with similar setup, found that bug shows up here too, and fixed it with patch listed above, so here it works OK now).

nilshoerrmann commented 13 years ago

GitHub closes issues automatically.

It does so when you have things like fix #123, fixes #123 or fixed #123 in your commit message.

nilshoerrmann commented 13 years ago

Just pulled your changes and seems to work perfectly. Thanks!

ahwayakchih commented 13 years ago

Thanks :).