0

In the Contact component, I have edited the file "contact.xml"

I changed the textfield named con_position from type="text" to type="calendar".

Here is the code:

<field
        name="con_position"
        type="calendar"
        label="COM_CONTACT_FIELD_INFORMATION_POSITION_LABEL"
        description="COM_CONTACT_FIELD_INFORMATION_POSITION_DESC"           
        showtime="false"
        format="%a %d %B %Y"
        size="22"
        filter="user_utc"       

    />

The data is gone after being saved. It's empty.

Can anyone let me know what I've done wrong?

2
  • 1
    What are you trying to achieve by changing the Positon field into a calendar field? Are you editing the Core files shipped with Joomla (bad idea) or via a plugin(good idea)?
    – Irata
    Apr 11, 2019 at 6:11
  • 1
    Please explain what "gone" looks like. Is it not presenting on the contact page? Is it not being stored in the table? Are there any generated notices, warnings, or errors? Do you have debugging turned on? Can you find the UPDATE query in the collection of queries being run? Do you know how/where to use $query->dump(); to specifically check the UPDATE query? Apr 11, 2019 at 10:52

1 Answer 1

1

The con_position column in the database is a simple text type -- VARCHAR(255), while the calendar field type would expect to be working with a column in the database of type DATE.

You need to change both the Form field in Joomla and the database field type in the #__contact_details table using mysql or phpmyadmin for it to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.