Closed andrewminton closed 6 years ago
I had some problems with this and it may not be 100% resolved. Can you tell me
Thanks.
I have textarea.*, gallery.*, image.*
as included element items (sections) within publish settings along with all options checked for new,link,edit,delete.
My Datasource has content:* with 'content' being the name I gave to the ERF field in my section.
Here's a pastie of the DS for my page datasource: http://pastie.org/private/lu2egrnv9iglvmpzcuuuq
Can you try to see what you get when you set the field's setting to *
As in change the included elements to: *
in the field section editor?
If so, done that, no joy.
:( And we are talking about the core Textarea Field ?
Yes correct. Core field using standard markdown extension.
Is it because we're not actually specifying the intended output with textarea:formatted in the DS?
Usually we have to specify that we'd like the output to be formatted or not. Maybe this is why it's just grabbing the default output as it appears in the value field and not the value-formatted filed from the DB.
Should we maybe spit out the formatted
and unformatted
modes into the DS by default? if it was left to the DS editor it may complicate the selection options too much.
If I replace $curMode
with formatted
on this line: https://github.com/DeuxHuitHuit/entry_relationship_field/blob/master/fields/field.entry_relationship.php#L704
The textarea outputs the formatted/escaped entity value. The values are definately there, it's just not choosing between value
and formatted_value
and just returns the first entry in array each time which will always be value
I guess.
Hum... can you var_dump($fieldIncludableElements) juste bfore this line: https://github.com/DeuxHuitHuit/entry_relationship_field/blob/master/fields/field.entry_relationship.php#L696
It should output ALL modes by default...
@nitriques The above returns null
for me. No matter what I include in the Publish settings tag list.... text.*
etc.. it always seems to return null
on the front end.
hum.. and what's in $curMode
?
By placing $curMode
on line 696
I get string 'formatted' (length=9)
returned.
So the variable contains the good information... I really wonder why the field does not produce the right value... Just to be sure: changing $curMode
to 'formatted'
solves the problem ?
The variable outputs an escaped entity string version of the textarea field and not html markup as it does normally with other datasources when you choose formatted
within the DS included elements. So it's not fully solved.
Ok. But do you have a different XML output by replacing the variable $curMode
(which contains 'formatted') to the hardcoded string 'formatted'
?
Not sure I understand what you mean above. I hard coded the variable $curMode
to 'formatted'
on line 696
and the above grab of my datasource show what I see in my debug.. escaped entities instead of html tags.
If I hard code 'formatted' in place of $curMode
or $subMode
in the following functions. It still returns the escaped entities seen in the screen grab.
The match-element being formatted renders me clue less...
just to be sure, if you create a datasource to output your child section, is the markup ok ?
and you do select 'content: *' in your current DS ?
Yes I'm selecting content:*
Weirdly I've just hard coded 'formatted' place of $subMode
and $curMode
variables and all is rendered correctly in the XML debug view.
Ok I'll try to tackle this ...
IF you need any more information about my environment.. I'm running a build of vagrant from this repo: https://github.com/lnikkila/symphony-simple-vagrant as a test environment to build my sites locally. Thanks.
Which version of Symphony is it ?
2.6.4 or 2.6.5 I believe. I'll need to check though as I'm not at my dev machine
I am not able to reproduce the bug... are you running 1.0.3 ?
Oh wait: Textbox are working, but not text area...
But I get this:
<item id="47" level="1" max-level="-1" section-id="42" section="text-area" matched-element="">
<text mode=""><![CDATA[test **sasa**]]></text>
<text-side mode=""><![CDATA[ test *sssasa*]]></text-side>
</item>
Thats what I see... unformatted. :(
At least we have the same output ! haha
Which is a good thing :)
I've isolated the problem down to the fact that the text area returns unformatted data when mode is null but textbox does the opposite.. meanwhile.. that's a bug..
haha! so glad it wasn't me this time :) So textbox returns formatted by default?
So textbox returns formatted by default?
If mode is null, yes.
Well there we are then.. consistency all round I see :)
Not sure if this has been discussed at all, but when you include all child elements in the ERF field. Textareas with formatters do not represent the correct output desired.
I see this sort of action on my textareas:
<content mode="">[CDATA[....#my content]]</content>
No mode and the markdown isn't rendered as HTML for me.
Is this not catered for with ERF?