News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

coding error in userfields admin view

Started by sealion, March 18, 2014, 18:11:40 PM

Previous topic - Next topic

sealion

There is a coding error in administrator/components/com_virtuemart/views/userfields/view.html/php line 81 should be

$userFieldPlugin = self::renderUserfieldPlugin(substr($userField->type, 6),$userField->params);


Not

$userFieldPlugin = self::renderUserfieldPlugin(substr($userField->type, 6),$userField);


It's a small thing but makes it impossible to correctly display userfield plugin parameters in the userfield admin. I happen to be trying to write a userfield plugin at the moment, I tested the change and it works as it should.

Milbo

Ehrm, please use the setConfigParameterable  stuff


var $varsToPush = array(
'param1'   => array(0, 'int'),// default value and filter (not supported in vm2.6 yet)
'param2'=> array(0, 'int'),
'param3'=> array(0, 'int'),
'param4' => array(0, 'int')
);
$this->setConfigParameterable ('params', $this->varsToPush);


Then the call is also correct.

Do not work with the param field yourself, let vm handle that for you :-)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sealion

Ok, I will try it that way.

I could not find any documentation on making a userfieldtype plugin, and there are no examples in among the plugins released with Virtuemart, so I am working quite a bit by trial and error. I just noticed in the code that there was a possibility of making a userfieldtype plugin to extend the shopper fields, so I decided to make one. I am trying to make a captcha field that will integrate with the Joomla captcha plugin type and can be used to stop spammy registrations. I am nearly there except for getting the parameters handled correctly.

I notice in the parent class vmUserFieldPlugin there are two methods for handling parameters, AddUserfieldParameter($params) and AddUserfieldParameterByPlgName($plgName) - how are these used? Or can these just be ignored?

jjk

#3
Quote from: sealion on March 19, 2014, 11:31:22 AM
... so I decided to make one. I am trying to make a captcha field that will integrate with the Joomla captcha plugin type and can be used to stop spammy registrations.

Hmm, I think you had this idea just a little bit too late, because that's already implemented in VM 2.5.4.
http://forum.virtuemart.net/index.php?topic=122785.msg418993#msg418993 "... - added recaptcha for registration and ask a question/recommened to a friend"
http://dev.virtuemart.net/projects/virtuemart/files

Concerning spammy registrations - Imho the 'SpambotCheck' and 'EasyCalcCheck Plus' are doing a pretty good job (with the first one, occationally a spam registration still slips through it's filters) and don't annoy the user with sometimes unsolvable reCaptchas.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

sealion

Actually there might still be a use for it, because the user field plugin I am making will not be restricted to recaptcha, it should integrate with whatever Joomla captcha plugin is being used. Also will work with versions of Virtuemart 2 prior to 2.5.4. But I will check out 2.5.4.