cleverreach error Call to a member function - typo3

After sending the newsletter registration (with powermail form), you will get an error message:
Call to a member function isReceiverOfGroupAndActive() on null
Error thrown in file
/html/typo3/typo3conf/ext/cleverreach/Classes/Powermail/Validator/OptinValidator.php in line 37.
What is causing this?

You need to downgrade the cleaverreach Extension to 0.1.5, they have added the new inject annotation

Related

"Access to an object's fields is only permitted within its methods" using callSoapService in Matlab

I am using SOAP protocol to get response from a website using Matlab codes. my code is as below
createClassFromWsdl('https://www.zarinpal.com/pg/services/WebGate/wsdl');
obj = PaymentGatewayImplementationService;
PaymentRequest(obj,'9b9eef82-7cde-11e7-b794-000c295eb8fc', 100 ,'comment','','','www.google.com')
when I Run this code, an error occured as below:
'Access to an object's fields is only permitted within its methods'
How can I solve this problem ?
when I replace obj.endpoint in PaymentRequest with 'https://www.zarinpal.com/pg/services/WebGate/service', another error occures as follow:
'java.net.SocketException: Connection reset'

jh_captcha throws "Validation failed while trying to call showAction"

I've implemented jh_captcha into my extension as descripted in the documentation:
https://docs.typo3.org/typo3cms/extensions/jh_captcha/Developer/Index.html#add-the-captcha-to-your-domain-model
It's working create within Actions like New, Edit or List. But I get the following error as soon showAction is called:
Validation failed while trying to call showAction
As soon as I remove NotEmpty from the validation the showActions are working, but New and Edit obviously not.
Possibly the validation fails on subobjects. There is also a solution to remove or change Validators inside the initializeXY Actions. Heres a german blog post about this topic: http://blog.teamgeist-medien.de/2016/02/typo3-extbase-validierung-von-unterobjekten-deaktivieren.html
You can add the annotation #dontvalidate $param on your showAction so the validation is not proceeded.

CodeIgniter email error

I use codeigniter to send email
but i have this error
Fatal error: Call to a member function load() on a non-object in /home/brokarsi/public_html/test/system/libraries/Email.php on line 1922
what is this error?
In my version of CodeIgniter (1.7.2) this corresponds to the following line :
$CI->lang->load('email');
I would guess the problem is that the Language library is not loaded but is required by the Email library. Could you try auto-loading the Language library?
system/application/config/autoload.php
$autoload['libraries'] = array(...., 'language');

Zend Validate, Display one message per validator

I am validating an email address using zend_validate_email.
For example, for email address aa#aa it throws several error messages including very technical describing that DNS mismatch (:S).
I am trying to make it display only 1 message that I want it to (for example: "Please enter a valid email").
Is there any way of doing it elegantly, apart from creating a subclass and overriding the isValid method, clearing out the array of error messages?
Thanks!
$validator = new Zend_Validate_EmailAddress();
// sets the message for all error types
$validator->setMessage('Please enter a valid email');
// sets the message for the INVALID_SEGMENT error
$validator->setMessage('Something with the part after the # is wrong', Zend_Validate_EmailAddress::INVALID_SEGMENT);
For a full list of errors and message templates see the Zend_Validate_EmailAddress class

Zend_Validate_Abstract custom validator not displaying correct error messages

I have two text fields in a form that I need to make sure neither have empty values nor contain the same string.
The custom validator that I wrote extends Zend_Validate_Abstract and works correctly in that it passes back the correct error messages. In this case either: isEmpty or isMatch.
However, the documentation says to use addErrorMessages to define the correct error messages to be displayed.
in this case, i have attached
->addErrorMessages(array("isEmpty"=>"foo", "isMatch"=>"bar"));
to the form field.
According to everything I've read, if I return "isEmpty" from isValid(), my error message should read "foo" and if i return "isMatch" then it should read "bar".
This is not the case I'm running into though. If I return false from is valid, no matter what i set $this->_error() to be, my error message displays "foo", or whatever I have at index[0] of the error messages array.
If I don't define errorMessages, then I just get the error code I passed back for the display and I get the proper one, depending on what I passed back.
How do I catch the error code and display the correct error message in my form?
The fix I have implemented, until I figure it out properly, is to pass back the full message as the errorcode from the custom validator. This will work in this instance, but the error message is specific to this page and doesn't really allow for re-use of code.
Things I have already tried:
I have already tried validator chaining so that my custom validator only checks for matches:
->setRequired("true")
->addValidator("NotEmpty")
->addErrorMessage("URL May Not Be Empty")
->addValidator([*customValidator]*)
->addErrorMessage("X and Y urls may not be the same")
But again, if either throws an error, the last error message to be set displays, regardless of what the error truly is.
I'm not entirely sure where to go from here.
Any suggestions?
I think you misinterpreted the manual. It says
addErrorMessage($message): add an
error message to display on form
validation errors. You may call this
more than once, and new messages are
appended to the stack.
addErrorMessages(array $messages): add
multiple error messages to display on
form validation errors.
These functions add custom error messages to the whole form stack.
If you want to display validation error messages when the validation fails, you have to implement the message inside your validator.
ie.
const EMPTY = 'empty';
protected $_messageTemplates = array(
self::EMPTY => "Value is required and can't be empty",
);
public function isValid($value)
{
if(empty($value)) {
$this->_error(self::EMPTY);
return false;
}
return true;
}
This way, after the validation fails, you can get the error codes using $validator->getErrors() and the error messages using $validator->getMessages().
If you have the $_messageTemplates properly defined, Zend_Form automatically uses the error messages instead of error codes and prints them out.
Hope this helps.