zend2 email validation - zend-form

I have FROM with validators. I use "pl_PL" as locale. In this form
validators like 'StringLength', 'EmailAddress'.
When I use 'Int' I have "Fatal error: Class 'Locale' not found in C:\ccc\bbbbbb\library\Zend\I18n\Validator\Int.php on line 63" info.

you need to install Intl extension, read this : http://php.net/manual/en/book.intl.php

Related

Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock"

I am upgrading the dependencies of my react-native application from 0.53 to 0.59.
But I am facing the below error while trying to build it using ./gradlew assembleRelease.
#babel/template placeholder "$1": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock".
#babel/template placeholder "$1": Property expression of ExpressionStatement expected node to be of a type ["Expression"] but instead got "TSModuleBlock"
at Object.validate (C:\vs-code-upgraded\node_modules#babel\types\lib\definitions\utils.js:132:11)
at validateField (C:\vs-code-upgraded\node_modules#babel\types\lib\validators\validate.js:24:9)
at validate (C:\vs-code-upgraded\node_modules#babel\types\lib\validators\validate.js:17:3)
at builder (C:\vs-code-upgraded\node_modules#babel\types\lib\builders\builder.js:38:27)
at Object.expressionStatement (C:\vs-code-upgraded\node_modules#babel\types\lib\builders\generated\index.js:316:31)
at applyReplacement (C:\vs-code-upgraded\node_modules#babel\template\lib\populate.js:86:27)
I would like to know if there is possiblity to solve this build error.
thank you in advance.
This might probably due to a namespace being exported which only contain interfaces/types (Not actual classes/functions/objects but type declarations).
A quick fix is to add declare to the exported namespace.
export declare namespace SomeNameSpace
instead of
export namespace SomeNameSpace

Yii2 File Validation .tar.xz

How can I limit file upload to .tar.xz extension only ?
Example (not working, only with xz):
[['file1'], 'file','extensions' => 'tar.xz']
So far I have only obtained success for non-composite extensions (zip, xz, etc)
As from version 2.0.36 of yii2, you probably do the following to allow composite extension validation:
[['file1'], 'file','extensions' => 'tar.xz', 'checkExtensionByMimeType' => false]
The option checkExtensionByMimeType is introduced if the mimetype of the extension is not compatible with the extension. for example, if you make a text file with an extension like ant.fox

populate_page_with method gives an error "Undefined method send_keys" when used with selenium web-driver

I am using page object gem with selenium web-driver. I am trying to automate gmail sign in page. So to enter mail_id and password I am using populate_page_with method.
I am storing my login credentials in a variable "data"
data = { :mail_id => 'abc#abc.com', :mail_password=> '12345' }
And calling populate_page_with method like below
populate_page_with data
When I am trying run the script it gives an error Undefined method send_keys.
But the implementation working fine when I am trying to automate yahoo mail sign in page.
My page object class is
class GmailSignInPage
include PageObject
button :gsubmit, :id => 'signIn'
text_field :mail_id, :id => 'Email'
text_field :mail_password, :id => 'Passwd'
def log_in_to_gmail(data = {})
self.mail_password_element.when_visible
populate_page_with data
self.gsubmit
end
end
My step-definition is
Given /^I navigate to gmail page$/ do
data = { :mail_id => 'abc#abc.com', :mail_password=> '12345' }
on(GmailSignInPage).log_in_to_gmail data
end
In supports/env.rb, I have added PageFactory class also
World(PageObject::PageFactory)
If I modify my log_in_to_gmail method like below then also I am getting same exception
undefined method 'send_keys' for #<NoMethodError: undefined method 'current' for Time:Class> (NoMethodError)
def log_in_to_gmail(data = {})
self.mail_password = data['mail_id']
self.mail_password = data['mail_password']
self.gsubmit
end
But if I use send_keys method its working fine except warning message
def log_in_to_gmail(data = {})
mail_id_element.send_keys data['mail_id']
mail_password_element.send_keys data['mail_password']
self.gsubmit
end
And the warning message is
*** DEPRECATION WARNING
*** You are calling a method named bridge at C:/jruby-1.7.6/lib/ruby/gems/shared/gems/page-object-0.9.2/lib/page-object/elements/element.rb:27:in 'wait_for_document_ready'.
*** This method does not exist in page-object so it is being passed to the driver.
*** This feature will be removed in the near future.
*** Please change your code to call the correct page-object method.
*** If you are using functionality that does not exist in page-object please request it be added.
So I think, this is not the issue with populate_page_with method because even assignment operator = gives same exception. This may be due to page_object gem unable handle gmail sign-in page.
Ok, lets try this again.
I have created a test and copy pasted all of the sample code you have above (Using the populate_page_with() method). I did make one key change to my code compared to yours:
Yours
on(GmailSignInPage).log_in_to_gmail data
Mine
GmailSignInPage.new(#browser).log_in_to_gmail data
I don't know what gem the on() method from your code is from. I could guess, but I want to make this answer more fact based that my previous one. :)
Once I did this, I was able to successfully sign in to Google. So there is nothing unusual about the Google sign in page or any limitation I can come across in the page-object gem or anything wrong with your approach.
So the only things that are different between us is the one line of code I put above, our dev environments, other dependent gems each of us are using.
Try replacing the above line and see if that works.
If not, I would recommend seeing if you have a gem conflict of some sort. Reason I suspect this is due to the strange exception methods you are getting:
undefined method 'send_keys' for # (NoMethodError)
The send_keys part I get, but 'current'? No 'current' method is being called and the Time class is no where to be seen in this example. That's one issue to look at isolating and seeing if you can clean up.

Yii generates error "Unable to resolve the request <controller/action>"

After logged in successfully, Yii does not executing any page.
Showing an error:
Error 404 Unable to resolve the request "membersdet/index"
Here membersdet is controller Id and index is an action.
Make sure the filename of your controller is EXACTLY "MembersdetController.php". It is case sensitive.
I guess you were developing on local machine under Windows OS and server runs on *nix system. That's normal issue for novice developers, that they forget about case sensitive file system in *nix.
It is because of wrong controller file name given or may be actionIndex() method is not in your controller.
I have had a similar problem and got it solved. In this case the file was correctly named but the class name was wrongly spelled. When these two do not correspond, you could get this error too.
Check case sensitive exactly your controller: MembersdetController
Check alias (common in config/main.php) map with namespace in your controller
Yii::setAlias('#tienn2t', dirname(dirname(__DIR__)) . '/tienn2t');
In MembersdetController.php file
<?php
namespace tienn2t\controllers;
use Yii;
use yii\web\Controller;
class MembersdetController extends Controller{
public function actionIndex(){
echo 1;die;
}
}
There is not enough information in the question, but maybe you have an incorrect .htaccess or if you don't have an htaccess at all you should use the url:
http://host/index.php?r=membersdet/index
Make sure you have MembersdetController in /protected/controllers/ and this class "is a" CController and has a public method named actionIndex().
Check errorHandler block in your config file.
I had fix this error like this
'errorHandler' => [
'errorAction' => 'error/index',
],
By the way you should have appropriate ErrorController in your module and /error/index.php
file in view folder.
Hope will help you.

Trying to use MAX(): "Fatal error: Undefined class constant"

$c = new Criteria();
$c->addSelectColumn('MAX('.Moto::matricula.')');
But i get this error:
Fatal error: Undefined class constant
'matricula' in /opt/lampp/htdocs/
prueba/lib/model/MotoPeer.php on line
25.
Any idea?
I'm using symfony 1.4 and propel 1.4.
Regards
Javi
It means that the class "Moto" doesn't have a variable "matricula" in it. This does not seem to have anything to do with (my)sql, but more with the (php?) class you are using.
Check out the source of that Moto class, and look if you have made a typo in the constant name?