Custom Module Parameters Fieldpath / Overrides Problem

730 views
Skip to first unread message

Jaybee

unread,
Mar 1, 2011, 9:49:28 AM3/1/11
to Joomla! CMS Development
Would someone be kind to see if they can replicate a problem I am
having with Module Parameter Overrides?

The full details are in this post: http://forum.joomla.org/viewtopic.php?f=629&t=598760

Cheers, Jamie.

Amy Stephen

unread,
Mar 1, 2011, 10:07:40 AM3/1/11
to joomla-...@googlegroups.com
Put the addfieldpath= statement on the fieldset line. Other than that, it looks good.

Example from component/com_content/views/article/tmpl/default.xml

<fields name="request">
        <fieldset name="request"
                addfieldpath="/administrator/components/com_content/models/fields">

                <field name="id" type="modal_article"
                        label="COM_CONTENT_FIELD_SELECT_ARTICLE_LABEL"
                        required="true"
                        description="COM_CONTENT_FIELD_SELECT_ARTICLE_DESC"
                />
        </fieldset>
</fields>

Ian MacLennan

unread,
Mar 1, 2011, 10:12:06 AM3/1/11
to joomla-...@googlegroups.com
In the future, please ask these sorts of questions in joomla-dev-general.

I would try renaming your files to use all lowercase.

Ian

For reference, the question is:
I have a strange problem which I think may be a bug, but just wanted to check-in here and see if anyone else has experienced a similar issue.

Basically, I have been building a 1.6 website locally (MAMP server) for the last month and have created some custom modules.

I created some form field overrides to tailor the module parameters in the administration. This works perfectly locally, but when I migrated the completed site over to my VPS yesterday, the overrides I have setup are being ignored and the default form fields are showing instead.

Here is the setup (I am showing only the relevant code, not the full tree) :

mod_mymodule.xml
Code:
<fields name="params" addfieldpath="templates/mytemplate/elements">

<field
   name="clientweb2"
   type="TextNew"
   label="mylabel"
   description="mydescription">
</field>

mytemplate > elements > textNew.php
Code:
class JFormFieldTextNew extends JFormField
{
   /**
    * The form field type.
    *
    * @var      string
    * @since   1.6
    */
   protected $type = 'TextNew';

I am also experiencing a similar problem with an article layout override. The override I have setup here is also being ignored and the only way to get it to work is to add the code to the the default.php in my template's html folder:

mytemplate > html > com_content > article > myArticle.php
mytemplate > html > com_content > article > default.php

I can select and assign the custom layout in the Article Options, under 'Choose a layout', but it just seems to load the default.php override instead.

Can anyone think of something which may cause these two things to fail on a live install, when both work fine on a localhost?

In regards to the first problem, I have tried various things, such as adding a slash at the beginning of the path:
Code:
<fields name="params" addfieldpath="/templates/mytemplate/elements">
...and moving the elements folder to the root, but nothing seems to make this work. As I mentioned above, everything works as expected locally, but the problem arises on the live server install.

Any suggestions would be greatly appreciated.



--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To post to this group, send an email to joomla-...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.


Jaybee

unread,
Mar 1, 2011, 10:45:43 AM3/1/11
to Joomla! CMS Development
Ian, many thanks - that did the trick.

I have noted your suggestion for where to post these types of
questions.

Cheers, Jamie.

On Mar 1, 3:12 pm, Ian MacLennan <ian.maclen...@joomla.org> wrote:
> In the future, please ask these sorts of questions in joomla-dev-general.
>
> I would try renaming your files to use all lowercase.
>
> Ian
>
> For reference, the question is:
> I have a strange problem which I think may be a bug, but just wanted to
> check-in here and see if anyone else has experienced a similar issue.
>
> Basically, I have been building a 1.6 website locally (MAMP server) for the
> last month and have created some custom modules.
>
> I created some form field overrides to tailor the module parameters in the
> administration. This works perfectly locally, but when I migrated the
> completed site over to my VPS yesterday, the overrides I have setup are
> being ignored and the default form fields are showing instead.
>
> Here is the setup (I am showing only the relevant code, not the full tree) :
>
> mod_mymodule.xml
> *Code:*
> <fields name="params" addfieldpath="templates/mytemplate/elements">
>
> <field
>    name="clientweb2"
>    type="TextNew"
>    label="mylabel"
>    description="mydescription">
> </field>
>
> mytemplate > elements > textNew.php
> *Code:*
> class JFormFieldTextNew extends JFormField
> {
>    /**
>     * The form field type.
>     *
>     * @var      string
>     * @since   1.6
>     */
>    protected $type = 'TextNew';
>
> I am also experiencing a similar problem with an article layout override.
> The override I have setup here is also being ignored and the only way to get
> it to work is to add the code to the the default.php in my template's html
> folder:
>
> mytemplate > html > com_content > article > myArticle.php
> mytemplate > html > com_content > article > default.php
>
> I can select and assign the custom layout in the Article Options, under
> 'Choose a layout', but it just seems to load the default.php override
> instead.
>
> Can anyone think of something which may cause these two things to fail on a
> live install, when both work fine on a localhost?
>
> In regards to the first problem, I have tried various things, such as adding
> a slash at the beginning of the path:
> *Code:*
Reply all
Reply to author
Forward
0 new messages