Giter Club home page Giter Club logo

Comments (7)

DerekBuntin avatar DerekBuntin commented on August 25, 2024 1

Please provide an example form for the subform field.

Module XML File:

<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1" client="site" method="upgrade">
    <name>mod_adonis_fixtures</name>
    <author>Adonis Media</author>
    <creationDate>July 2022</creationDate>
    <copyright>(C) 2010-2022 Adonis Media, All Rights Reserved</copyright>
    <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
    <authorEmail>[email protected]</authorEmail>
    <authorUrl>www.adonis.media</authorUrl>
    <version>1.0.0</version>
    <description>MOD_ADONIS_FIXTURES_XML_DESCRIPTION</description>

    <customContent/>

    <files>
        <filename module="mod_adonis_fixtures">mod_adonis_fixtures.php</filename>
        <folder>tmpl</folder>
    </files>
    <languages folder="language">
        <language tag="en-GB">en-GB.mod_adonis_fixtures.ini</language>
        <language tag="en-GB">en-GB.mod_adonis_fixtures.sys.ini</language>
    </languages>

    <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADONIS_FIXTURES_HTML"/>
    <config>
        <fields name="params">
            <fieldset name="fixtures" label="MOD_FIXTURES_FIELDSET_LABEL">
                <field
                        name="show_next_match_section"
                        type="radio"
                        label="MOD_ADONIS_FIXTURES_FIELD_SHOW_NEXT_MATCH_SECTION_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_SHOW_NEXT_MATCH_SECTION_DESC"
                        class="btn-group btn-group-yesno"
                        default="1"
                        filter="integer"
                >
                    <option value="1">JYES</option>
                    <option value="0">JNO</option>
                </field>
                <field
                        name="show_future_match_section"
                        type="radio"
                        label="MOD_ADONIS_FIXTURES_FIELD_SHOW_FUTURE_MATCH_SECTION_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_SHOW_FUTURE_MATCH_SECTION_DESC"
                        class="btn-group btn-group-yesno"
                        default="1"
                        filter="integer"
                >
                    <option value="1">JYES</option>
                    <option value="0">JNO</option>
                </field>
                <field
                        name="hide_name_mobile"
                        type="radio"
                        label="MOD_ADONIS_FIXTURES_FIELD_HIDE_NAME_MOBILE_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_HIDE_NAME_MOBILE_DESC"
                        class="btn-group btn-group-yesno"
                        default="1"
                        filter="integer"
                >
                    <option value="1">JYES</option>
                    <option value="0">JNO</option>
                </field>
                <field
                        name="show_short_name_mobile"
                        type="radio"
                        label="MOD_ADONIS_FIXTURES_FIELD_SHOW_SHORT_NAME_MOBILE_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_SHOW_SHORT_NAME_MOBILE_DESC"
                        class="btn-group btn-group-yesno"
                        default="1"
                        filter="integer"
                >
                    <option value="1">JYES</option>
                    <option value="0">JNO</option>
                </field>
                <field
                        name="next_match_wrapper_class"
                        type="text"
                        label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_WRAPPER_CLASS_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_WRAPPER_CLASS_DESC"
                />
                <field
                        name="next_match_header"
                        type="text"
                        label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_HEADER_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_HEADER_DESC"
                        default="Next Match"
                />
                <field
                    label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_BANNER_LABEL"
                    description="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_BANNER_DESC"
                    name="next_match_banner"
                    type="media"
                    preview="true"
                />
                <field
                        name="next_match_banner_alt"
                        type="text"
                        default="Next Match"
                        label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_BANNER_ALT_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_EXT_MATCH_BANNER_ALT_DESC"
                />
                <field
                        name="next_match_link"
                        type="url"
                        default=""
                        label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_LINK_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_LINK_DESC"
                />
                <field
                        name="next_match_link_class"
                        type="text"
                        default=""
                        label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_LINK_CLASS_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_LINK_CLASS_DESC"
                />
                <field
                        name="next_match_link_new_window"
                        type="radio"
                        label="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_LINK_NEW_WINDOW_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_NEXT_MATCH_LINK_NEW_WINDOW_DESC"
                        class="btn-group btn-group-yesno"
                        default="1"
                        filter="integer"
                >
                    <option value="1">JYES</option>
                    <option value="0">JNO</option>
                </field>
                <field
                        name="future_match_header"
                        type="text"
                        label="MOD_ADONIS_FIXTURES_FIELD_FUTURE_MATCH_HEADER_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_FUTURE_MATCH_HEADER_DESC"
                        default=""
                />
                <field
                        name="fixtures"
                        type="subform"
                        formsource="modules/mod_adonis_fixtures/forms/fixture.xml"
                        multiple="true"
                        required="true"
                        label="MOD_ADONIS_FIXTURES_FIELD_FIXTURES_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_FIXTURES_DESC"
                />
            </fieldset>
            <fieldset name="options" label="COM_MODULES_BASIC_FIELDSET_LABEL">
                <field
                        name="prepare_content"
                        type="radio"
                        label="MOD_ADONIS_FIXTURES_FIELD_PREPARE_CONTENT_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_PREPARE_CONTENT_DESC"
                        class="btn-group btn-group-yesno"
                        default="0"
                        filter="integer"
                >
                    <option value="1">JYES</option>
                    <option value="0">JNO</option>
                </field>

                <field
                        name="background-image"
                        type="media"
                        label="MOD_ADONIS_FIXTURES_FIELD_BACKGROUND_IMAGE_LABEL"
                        description="MOD_ADONIS_FIXTURES_FIELD_BACKGROUND_IMAGE_DESC"
                />
            </fieldset>
            <fieldset name="advanced">
                <field
                        name="layout"
                        type="modulelayout"
                        label="JFIELD_ALT_LAYOUT_LABEL"
                        description="JFIELD_ALT_MODULE_LAYOUT_DESC"
                        validate="moduleLayout"
                />

                <field
                        name="moduleclass_sfx"
                        type="textarea"
                        label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
                        description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
                        rows="3"
                />

                <field
                        name="cache"
                        type="list"
                        label="COM_MODULES_FIELD_CACHING_LABEL"
                        description="COM_MODULES_FIELD_CACHING_DESC"
                        default="1"
                        filter="integer"
                >
                    <option value="1">JGLOBAL_USE_GLOBAL</option>
                    <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
                </field>

                <field
                        name="cache_time"
                        type="number"
                        label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
                        description="COM_MODULES_FIELD_CACHE_TIME_DESC"
                        default="900"
                        filter="integer"
                />

                <field
                        name="cachemode"
                        type="hidden"
                        default="static"
                >
                    <option value="static"></option>
                </field>
            </fieldset>
        </fields>
    </config>
</extension>

First Subform:

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <field
            name="league"
            type="text"
            label="MOD_ADONIS_FIXTURES_FIELD_LEAGUE_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_LEAGUE_DESC"
            required="true"
    />
    <field
            name="date"
            type="calendar"
            default="now + 1 week"
            label="MOD_ADONIS_FIXTURES_FIELD_DATE_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_DATE_DESC"
            required="true"
            filter="user_utc"
            showtime="true"
            format="%Y-%m-%d %H:%M"
            todaybutton="false"
            filltable="false"
            translateformat="true"
    />
    <field
            name="location"
            type="text"
            label="MOD_ADONIS_FIXTURES_FIELD_LOCATION_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_LOCATION_DESC"
            required="true"
    />
    <field
            name="link"
            type="url"
            default=""
            label="MOD_ADONIS_FIXTURES_FIELD_LINK_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_LINK_DESC"
    />
    <field
            name="link_text"
            type="text"
            default="More Details"
            label="MOD_ADONIS_FIXTURES_FIELD_LINK_TEXT_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_LINK_TEXT_DESC"
    />
    <field
            name="link_class"
            type="text"
            default=""
            label="MOD_ADONIS_FIXTURES_FIELD_LINK_CLASS_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_LINK_CLASS_DESC"
    />
    <field
            name="link_new_window"
            type="radio"
            label="MOD_ADONIS_FIXTURES_FIELD_LINK_NEW_WINDOW_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_LINK_NEW_WINDOW_DESC"
            class="btn-group btn-group-yesno"
            default="1"
            filter="integer"
    >
        <option value="1">JYES</option>
        <option value="0">JNO</option>
    </field>
    <field
            name="teams"
            type="subform"
            multiple="true"
            buttons="move"
            label="MOD_ADONIS_FIXTURES_FIELD_TEAMS_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_TEAMS_DESC"
            max="2"
            min="2"
            formsource="modules/mod_adonis_fixtures/forms/team.xml"
    />
</form>

Child Subform:

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <field
            name="result"
            type="text"
            label="MOD_ADONIS_FIXTURES_FIELD_TEAM_RESULT_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_TEAM_RESULT_DESC"
    />
    <field
            name="team_name"
            type="text"
            label="MOD_ADONIS_FIXTURES_FIELD_TEAM_NAME_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_TEAM_NAME_DESC"
            required="true"
    />
    <field
            name="team_short_name"
            type="text"
            label="MOD_ADONIS_FIXTURES_FIELD_TEAM_SHORT_NAME_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_TEAM_SHORT_NAME_DESC"
    />
    <field
            label="MOD_ADONIS_FIXTURES_FIELD_TEAM_LOGO_LABEL"
            description="MOD_ADONIS_FIXTURES_FIELD_TEAM_LOGO_DESC"
            name="team_logo"
            type="media"
            preview="true"
            directory="teamlogos"
    />
</form>

from joomla-cms.

Fedik avatar Fedik commented on August 25, 2024

Please provide an example form for the subform field.

from joomla-cms.

Fedik avatar Fedik commented on August 25, 2024

Thanks,
Remove min attribute for teams subform, and it will work.
It is known bug, you can follow #43652
I close current issue as duplicate.

from joomla-cms.

DerekBuntin avatar DerekBuntin commented on August 25, 2024

Thanks, Remove min attribute for teams subform, and it will work. It is known bug, you can follow #43652 I close current issue as duplicate.

Confirmed, thanks Fedik, I did review that other issue earlier today and never thought to check the form fields :-)

from joomla-cms.

DerekBuntin avatar DerekBuntin commented on August 25, 2024

Thanks, Remove min attribute for teams subform, and it will work. It is known bug, you can follow #43652 I close current issue as duplicate.

Hi @Fedik

It seems when I remove the min attribute the subform doesn't load the child form, the field is there but the form does not load. Adding min back shows the form.

Any ideas when this will be resolved?

from joomla-cms.

Fedik avatar Fedik commented on August 25, 2024

I see you have only buttons="move" buttons, that can explain it.
Try with add button, I know it maybe not exactly what you want, but as long as you have max=2 it should be very close to what you wanted.

Any ideas when this will be resolved?

No idea. It is only affect nested subforms, regular subform works fine.

from joomla-cms.

Fedik avatar Fedik commented on August 25, 2024

Btw, another thing to try, is to add min="1" to the root subform, in theory then min="2" in the nested subform will work.
But need to test, just theory.

from joomla-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.