Skip to content
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

[com_fields] not display in com_contact form #12673

Closed
ghost opened this issue Nov 1, 2016 · 54 comments
Closed

[com_fields] not display in com_contact form #12673

ghost opened this issue Nov 1, 2016 · 54 comments

Comments

@ghost
Copy link

ghost commented Nov 1, 2016

Steps to reproduce the issue

create a com_contact named Contact , category Forms
create a custom field (radio : Sex->M/F) for com_contact form, category Forms

in Contact settings:
tab Display -> Show User Custom Fields -> All (category Forms is not in the list)
tab Fields -> sex displayed as label only Sex

Expected result

custom field Sex should be displayed in frontend contact form

Actual result

not displayed

System information (as much as possible)

php 5.6
on localhost AMPPS

Additional comments

question for @laoneo #11833 (comment)

@laoneo
Copy link
Member

laoneo commented Nov 1, 2016

Did you switch to contact form context Mail?
image

@ghost
Copy link
Author

ghost commented Nov 1, 2016

No look at my screenshots

fields
contact
contact-frontend

@ghost
Copy link
Author

ghost commented Nov 1, 2016

fiels-values
field-edit

@laoneo
Copy link
Member

laoneo commented Nov 1, 2016

You need to set them for the context Mail, otherwise they will appear on contacts.

@ghost
Copy link
Author

ghost commented Nov 1, 2016

I cannot switch from contact to mail , and if I select mail I cannot create a custom field
no idea how to do it
and no idea how to set a contact custom field to mail, there is no option for it

@laoneo
Copy link
Member

laoneo commented Nov 1, 2016

In the list where the fields are displayed (as shown in my screenshot of the first comment) select mail. Then hit the new button and create your field.

@ghost
Copy link
Author

ghost commented Nov 1, 2016

ok got it ! , the field is displayed but not as radio buttons
sex (optional)

<div class="control-label">
            <label id="jform_params_field_mail_sex-lbl" for="jform_params_field_mail_sex" class="">
    Sex</label>
                            <span class="optional">(optional)</span>
                    </div>

screenshot 2016-11-01 a 10 46 41

@ghost
Copy link
Author

ghost commented Nov 1, 2016

added another field -> Job (text)
it's displayed but disabled and disabled = no in the settings

<div class="controls"><input type="text" name="jform[params][mail-field-job]" id="jform_params_mail_field_job" value="" disabled="">
</div>

@ghost
Copy link
Author

ghost commented Nov 1, 2016

And now the tab Fields is not displayed anymore

screenshot 2016-11-01 a 11 01 46

@joomla-cms-bot joomla-cms-bot changed the title [com_fields] not display in com_contat form [com_fields] not display in com_contact form Nov 1, 2016
@laoneo
Copy link
Member

laoneo commented Nov 1, 2016

This fields do belong to the front end form. You will see the fields on the contact form on the front end.

@ghost
Copy link
Author

ghost commented Nov 1, 2016

no they are not on the frontend form
the text field is disabled and the radio buttons are not displayed

the code displayed on front end

<form id="contact-form" action="/j37/index.php/contact-form" method="post" class="form-validate form-horizontal well">
                                                            <fieldset>
                                            <legend>Send an Email</legend>
                                                                                        <div class="control-group">
            <div class="control-label">
            <span class="spacer"><span class="before"></span><span class="text"><label id="jform_spacer-lbl" class=""><strong class="red">*</strong> Required field</label></span><span class="after"></span></span>                    </div>
        <div class="controls"> </div>
</div>
                                                                    <div class="control-group">
            <div class="control-label">
            <label id="jform_contact_name-lbl" for="jform_contact_name" class="hasPopover required" title="" data-content="Your name." data-original-title="Name">
    Name<span class="star">&nbsp;*</span></label>
                    </div>
        <div class="controls"><input type="text" name="jform[contact_name]" id="jform_contact_name" value="" class="required" size="30" required="required" aria-required="true">
</div>
</div>
                                                                    <div class="control-group">
            <div class="control-label">
            <label id="jform_contact_email-lbl" for="jform_contact_email" class="hasPopover required" title="" data-content="Email Address for contact." data-original-title="Email">
    Email<span class="star">&nbsp;*</span></label>
                    </div>
        <div class="controls"><input type="email" name="jform[contact_email]" class="validate-email required" id="jform_contact_email" value="" size="30" autocomplete="email" required="required" aria-required="true"></div>
</div>
                                                                    <div class="control-group">
            <div class="control-label">
            <label id="jform_contact_emailmsg-lbl" for="jform_contact_emailmsg" class="hasPopover required" title="" data-content="Enter the subject of your message here." data-original-title="Subject">
    Subject<span class="star">&nbsp;*</span></label>
                    </div>
        <div class="controls"><input type="text" name="jform[contact_subject]" id="jform_contact_emailmsg" value="" class="required" size="60" required="required" aria-required="true">
</div>
</div>
                                                                    <div class="control-group">
            <div class="control-label">
            <label id="jform_contact_message-lbl" for="jform_contact_message" class="hasPopover required" title="" data-content="Enter your message here." data-original-title="Message">
    Message<span class="star">&nbsp;*</span></label>
                    </div>
        <div class="controls"><textarea name="jform[contact_message]" id="jform_contact_message" cols="50" rows="10" class="required" required="required" aria-required="true"></textarea></div>
</div>
                                                                    <div class="control-group">
            <div class="control-label">
            <label id="jform_contact_email_copy-lbl" for="jform_contact_email_copy" class="hasPopover" title="" data-content="Sends a copy of the message to the address you have supplied." data-original-title="Send a copy to yourself">
    Send a copy to yourself</label>
                            <span class="optional">(optional)</span>
                    </div>
        <div class="controls"><input type="checkbox" name="jform[contact_email_copy]" id="jform_contact_email_copy" value="1"></div>
</div>
                                    </fieldset>
                                                                                                    <fieldset>
                                            <legend>Fields</legend>
                                                                                        <div class="control-group">
            <div class="control-label">
            <label id="jform_params_field_mail_sex-lbl" for="jform_params_field_mail_sex" class="">
    Sex</label>
                            <span class="optional">(optional)</span>
                    </div>
        <div class="controls"><fieldset id="jform_params_field_mail_sex" class="radio" disabled="">

    </fieldset>
</div>
</div>
                                                                    <div class="control-group">
            <div class="control-label">
            <label id="jform_params_mail_field_job-lbl" for="jform_params_mail_field_job" class="">
    Job</label>
                            <span class="optional">(optional)</span>
                    </div>
        <div class="controls"><input type="text" name="jform[params][mail-field-job]" id="jform_params_mail_field_job" value="" disabled="">
</div>
</div>
                                    </fieldset>
                            <div class="control-group">
            <div class="controls">
                <button class="btn btn-primary validate" type="submit">Send Email</button>
                <input type="hidden" name="option" value="com_contact">
                <input type="hidden" name="task" value="contact.submit">
                <input type="hidden" name="return" value="">
                <input type="hidden" name="id" value="1:contact-form">
                <input type="hidden" name="2c0b5a8a134b8e672ef31fe0ecdf3e5b" value="1">         </div>
        </div>
    </form>

@ghost
Copy link
Author

ghost commented Nov 1, 2016

text field disabled
radio button not displayed

screenshot 2016-11-01 a 16 08 59

@laoneo
Copy link
Member

laoneo commented Nov 1, 2016

You need to set the edit value permission for the public group to allowed.

@ghost
Copy link
Author

ghost commented Nov 1, 2016

in User Groups > Edit > allowed , nothing changes
in the field itself > Permissions > all to Allowed , but nothing change

and allow editing to public for all is not what one want, one want only permissions for contact custom fields

@laoneo
Copy link
Member

laoneo commented Nov 2, 2016

I was talking about the "Edit Value" permission
image

@ghost
Copy link
Author

ghost commented Nov 2, 2016

ok now it works for textarea but not for radio buttons, they are not displayed

<div class="controls"><fieldset id="jform_params_field_mail_sex" class="radio"></fieldset></div>

@infograf768
Copy link
Member

Concerning permissions, see #12693

@ghost
Copy link
Author

ghost commented Nov 2, 2016

@infograf768 I have set the permissions but button radio are not displayed

@infograf768
Copy link
Member

I meant that permissions are flawed imho in com_fields. They are unsufficient at best.

@laoneo
Copy link
Member

laoneo commented Nov 2, 2016

@infograf768 please discus the sense of the new permission in #12693 and not here. The problem is that the checkbox is not shown properly.

@ghost
Copy link
Author

ghost commented Nov 2, 2016

@laoneo I did something wrong with radio buttons or do you get the same result than me ?

thanks a lot for your work and I keep on trying all :-)

@laoneo
Copy link
Member

laoneo commented Nov 2, 2016

Yes, also on the back end. I try to fix it...

@laoneo
Copy link
Member

laoneo commented Nov 2, 2016

Glad to hear that the rest is working. Please test #12698 which should fix the display issue for radio buttons and checkboxes.

@ghost
Copy link
Author

ghost commented Nov 2, 2016

Not sure if I did it right
libraries/joomla/form/parameters/radio.xml
the xml value now :

<field
name="name"
label="JLIB_FORM_FIELD_PARAM_RADIO_MULTIPLE_VALUES_KEY_LABEL"
size="30"
type="text"
/>

doesn't work , no radio button in frontend

and I have another problem in backend, the tab fields doesnt exist anymore
screenshot 2016-11-02 a 16 04 49

@laoneo
Copy link
Member

laoneo commented Nov 3, 2016

You need to save the values again when you edit the radio field.

@ghost
Copy link
Author

ghost commented Nov 5, 2016

I saved the values again
options-cf
but what I get is wrong
form-cf

the displayed code

<fieldset id="jform_params_field_mail_sex" class="radio">
<input type="radio" id="jform_params_field_mail_sex0"
 name="jform[params][field-mail-sex]" 
value="M">
<label for="jform_params_field_mail_sex0">1</label>
<input type="radio" id="jform_params_field_mail_sex1" 
name="jform[params][field-mail-sex]" 
value="F">
<label for="jform_params_field_mail_sex1">F</label>
</fieldset>

it should be

<input type="radio" id="jform_params_field_mail_sex1" 
name="jform[params][field-mail-sex]" 
value="1">
<label for="jform_params_field_mail_sex1">M</label>
<input type="radio" id="jform_params_field_mail_sex0" 
name="jform[params][field-mail-sex]" 
value="0">
<label for="jform_params_field_mail_sex0">F</label>

in the admin panel there is no fields tab anymore
admin-missing-tab
this fields tab exists in com_content

Send a copy to yourself should be just before the button send email and not between the core and custom fields but maybe it can be fixed with view overrides

thanks for your work

@ghost
Copy link
Author

ghost commented Nov 5, 2016

if I submit the contact form I get that email

This is an enquiry email via http://192.168.178.20/j37/ from:
My Name<my@email>

contenu de mon message

<br />
<b>Notice</b>:  Undefined property: stdClass::$render_class in <b>/www/j37/components/com_contact/layouts/field/render.php</b> on line <b>19</b><br />
Sex: F
<br />
<b>Notice</b>:  Undefined property: stdClass::$render_class in <b>/www/j37/components/com_contact/layouts/field/render.php</b> on line <b>19</b><br />
Job: photographe

job: photographe is the custom field type= text (it works)

@laoneo
Copy link
Member

laoneo commented Nov 7, 2016

The render notice should be solved with the merge of PR #12729.

The key value confusion is discussed here #12739. You need to flip the values and keys in the list definition.

@laoneo
Copy link
Member

laoneo commented Nov 14, 2016

Can you please test it with the most actual code from staging as most of the issues you experience should be solved now. Thanks.

@ghost
Copy link
Author

ghost commented Nov 14, 2016

I never know what to download and install exactly, is there a very las version of joomla with your code ?

thank you

@laoneo
Copy link
Member

laoneo commented Nov 14, 2016

You can download the latest builds from here https://developer.joomla.org/nightly-builds.html.

@ghost
Copy link
Author

ghost commented Nov 17, 2016

new install J37 last version

same radio buttons Field, I get the email

This is an enquiry email via http://192.168.178.20/j37/ from:
NAME <[email protected]>

MESSAGE

<dl class="fields-container article-info muted"></dl>

with dl class="fields-container article-info muted"... instead of the radio value

and as I said before the fields tab is not displayed any more in the contact form edit, it's missing

<ul class="nav nav-tabs" id="myTabTabs"><li class="active"><a href="#details" data-toggle="tab">Edit Contact</a></li><li class=""><a href="#misc" data-toggle="tab">Miscellaneous Information</a></li><li class=""><a href="#attrib-display" data-toggle="tab">Display</a></li><li class=""><a href="#attrib-email" data-toggle="tab">Form</a></li><li class=""><a href="#publishing" data-toggle="tab">Publishing</a></li></ul>

displayed in com_content but missing in com_contact
<li class=""><a href="#attrib-fields-0" data-toggle="tab">Fields</a></li>

@ghost
Copy link
Author

ghost commented Nov 17, 2016

If I create a field group my-fields it is not displayed in the box Field Group Type or select a group , even by typing
screenshot 2016-11-17 a 10 27 02

@ghost
Copy link
Author

ghost commented Nov 22, 2016

any news ? :-)

@laoneo
Copy link
Member

laoneo commented Nov 24, 2016

I need to test that, sorry for the late response, but I was occupied with some other things.

@ghost
Copy link
Author

ghost commented Nov 24, 2016

no problem ... I wasn't sure if you had seen my replies, thanks for your work

@laoneo
Copy link
Member

laoneo commented Nov 26, 2016

I'v just tested it with the latest code from staging and it worked. Here is a screenshot about my form
image

And here the raw output which will be sent by mail

This is an enquiry email via http://joomla.box/cms/ from:
Test <[email protected]>

Demo

Dep: Accounting, Development

So I suggest that you are doing a new installation of the most actual Joomla code and then redo the test again.

@laoneo
Copy link
Member

laoneo commented Dec 14, 2016

Can we close this one?

@laoneo
Copy link
Member

laoneo commented Jan 26, 2017

I guess we can close this one as, as I and other have been testing contacts extensively in the last weeks.

@Bakual
Copy link
Contributor

Bakual commented Jan 26, 2017

Closing as there was no response.

@Bakual Bakual closed this as completed Jan 26, 2017
@ghost
Copy link
Author

ghost commented May 1, 2017

the new fields are disabled

@brianteeman
Copy link
Contributor

Check the permissions for the field!

@ghost
Copy link
Author

ghost commented May 1, 2017

Thanks but what should be the permissions ? that it works as expected for everybody

anyway the com_contact form never send anything .... with SMTP or with PHP mail , it just does not work

@ghost
Copy link
Author

ghost commented May 1, 2017

ok now it works but if I get the email the custom field is displayed in that way

<div class="field-container" data-alias="">
<span class="field-label">telefon: </span>
<span class="field-value">0</span>
</div>
`

how can I customize the email ?

thank you

@laoneo
Copy link
Member

laoneo commented May 1, 2017

That doesn't really makes sense. Can you open please a new issue which describes the problem and what do you expect for the fields? Thanks.

@ghost
Copy link
Author

ghost commented May 1, 2017

I have really no idea how works Github and where to open a new issue

I give up with Github i'll try on https://issues.joomla.org

thank you

@brianteeman
Copy link
Contributor

brianteeman commented May 1, 2017 via email

@ghost
Copy link
Author

ghost commented May 1, 2017

thanks

@ghost
Copy link
Author

ghost commented May 4, 2017

impossible to write Zahnärztin in the Text , only in the Value, for a custom field type list, I must write Zahnaerztin that it works but it is necessary to get Zahnärztin written on front-end

Warning: SimpleXMLElement::__construct(): Entity: line 2: parser error : Entity 'auml' not defined in /libraries/joomla/form/form.php on line 728

Warning: SimpleXMLElement::__construct(): ZahnarztZahnä in /libraries/joomla/form/form.php on line 728

Warning: SimpleXMLElement::__construct(): ^ in /libraries/joomla/form/form.php on line 728

@laoneo
Copy link
Member

laoneo commented May 4, 2017

Please open a new issue with the steps to reproduce your error. Make sure you are using the 3.7 final version. Thanks.

@ghost
Copy link
Author

ghost commented May 4, 2017

I am using the 3.7 final version
if you write a char like ä or a letter with any accent on custom field type list you get that error

line 728 = $data = new SimpleXMLElement($data);

@ghost
Copy link
Author

ghost commented May 4, 2017

@YMages Please open a new issue with the steps to reproduce your error as @laoneo wrote, thanks.

@laoneo
Copy link
Member

laoneo commented May 4, 2017

Can somebody lock that issue please?

@brianteeman
Copy link
Contributor

locked as requested

@joomla joomla locked and limited conversation to collaborators May 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants