Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » UserForms 0.2 RC 2

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3 4
Go to End
Author Topic: 3908 Views
  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    I just (3 hours ago) downloaded UserForms-v0.2.tar from the Modules section because it said it was v0.2, or I think it did. Now when I go there it says v0.1 with a link to v0.2rc2. Am I imagining things?

    The tar file won't open anyway which is why I went back. If 0.2 isn't stable then I'll give rc2 a go.

    Cheers,

    Bemused

  • slang
    Avatar
    Community Member
    6 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    I too get an error

    Fatal error: Method name must be a string in /var/sites/<sitename>/sapphire/forms/Form.php on line 245

    on a completely new install of 2.3.2 with userforms 0.2-rc2, spamprotection 0.2, recaptcha 0.3, mollom 0.2, googlemapselectionfield 0.1

    I put userforms in /mysite/userforms (with the s on the end...)

    I installed silverstripe 2.3.2, with the userforms etc. logged in as admin, and inserting a userform field didn't produce an error, but failed to actually work. I did a /dev/build and then an /admin/?flush=1 and then the error started.

    I've had this error with userforms with all of the 0.2 vesrions (incl. svn) that I have tried. I simply can not get it to work.

    I tried installing potentially related modules (spamprotection etc.) in case that would help, but it does not.

    This is very frustrating now - have been trying (on and off) for months to get this. In the end, I had to revert to a silverstripe version that has userforms included.

    Any suggestions as to what can be done to diagnose this?

  • slang
    Avatar
    Community Member
    6 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    Hmmmmmmmm.

    Well, for some reason (and I remember reading it), I was putting the userforms directory under the mysite directory.

    I have since moved it to the root of the site, and am no longer getting the error. I've tested it, and it seems to be working fine.

    Hopefully this tip may help others.

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    slang - If you can remember were you read it let me know so I can change it

    sicp - Yes sorry I was getting 1 step ahead of myself. You can download the 0.2rc2 off the sticky thread in this forum

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    Hi Willr,
    I'm happily playing around with the new userforms, and all goes well except for one thing: for some reason the Mollom field is always active - even when the form is first called. On my custom forms Mollom is working fine... Using the latest revision and SS2.3.2. Didnt find anything on this. Do you have any ideas?

  • Juanitou
    Avatar
    Community Member
    323 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    Same here, I didn't find why it happens.

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    I might have found something. I can force this behaviour to appear in my Custom Form by disabling the following line:

    if($protector) $protector->setFieldMapping('Name', 'Comments')

    The Custom Form uses the MollomSpamProtection::updateForm() function, that does some work like verifying the keys and initiating the ServerList. It then returns the new MollomField(..). After the field is created, the FieldMapping is done that makes Mollom dynamic.

    The userforms do no such thing: they create an EditableSpamProtectionField instead, that finds the current Spamprotector (Mollom) and creates a MollomField. Mollom keys are never verified, and no FieldMapping is done, making the Mollom field appear as default. And there doesn't seem to be a way to add the mapping 'by hand'.

    I might have missed something, but it looks like this is it?

    BTW: as the MollomField constructor calls initServer, this method is called twice for Custom Forms, just thought to mention...

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: UserForms 0.2 RC 2 Link to this post

    for some reason the Mollom field is always active - even when the form is first called

    Yes as you said, Mollom only hides if you give it a field mapping. For userforms we do not give it a field mapping currently so it will always show. To get mollom working as per other forms you would need to generate an array of all the fields you would like the spam protector to cover. So I would think any EditableTextFields.

    Coding completely off the top of my head, you could try

    $fields = $this->Fields(); // in UserDefinedForm.php
    $protector->setFieldMapping($fields->map('Name')); // I think this takes an array of fieldnames

    3908 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.