Symfony2 validation constraint 'Symfony\Component\Validator\Constraints\MaxLength' not found - class

I am new to Symfony and frameworks so have been following the Symblog tutorial but have become stuck when validating the forms.
Get this error...
FatalErrorException: Error: Class
'Symfony\Component\Validator\Constraints\MaxLength' not found in
/Applications/MAMP/htdocs/Portfolio/Symfony/src/Blogger/BlogBundle/Entity/Enquiry.php
line 71
Where am I going wrong?
B

MaxLength is deprecated since symfony 2.1 use Length with the max option set.
The reference can be found in UPGRADE-2.1.md in the validator section.

Related

fox:alt-text not allowed to appear in element 'fo:external-graphic'."

I'm trying to add the alternate text into my images just as the Apache FOP documentation instructs: By using fox-alt:-text.
<fo:external-graphic src="logo.gif" content-width="75%" content-height="75%" fox:alt-text="My company logo"/>
I'm using Apache FOP version 2.5 and accessibility is ON (setted true in fop.xconf). For some reason I'm getting an error message saying
org.xml.sax.SAXParseException:cvc-complex-type.3.2.2: Attribute 'fox:alt-text' is not allowed to appear in element 'fo:external-graphic'.
Any ideas on what might be wrong?
I now realized that the problem is not in Apache FOP but it's in my code. Our system is doing some additional schema validation (javax.xml.validation.Validator) against the plain fo schema and doesn't see the fox extension.
fox:alt-text is not a part of the original fo schema's fo:external-graphic definition and is causing validation failures.

How to Check which validation is violated for a model in Yii2

when I print ths statement inside a model as,
Yii::error($this->validate());
it gives me
false
QUESTION :
How can I check which validation is getting violated? As I have 38 parameters with different rules, I am tired debugging application. any help?
You can get the errors for your model this way:
$this->getErrors();
Reference:
Class yii\base\Model->getErrors() documentation

How can I avoid Flask-Admin 2.1 warning "UserWarning: Fields missing from ruleset"?

I'm using Flask-Admin 2.1 with Python 2.7.6.
One of my Flask-Admin model classes inherits from flask.ext.admin.contrib.sqla.ModelView and overrides form_rules.
When I run my application, this warning is displayed: "UserWarning: Fields missing from ruleset"
The warning is accurate: There are fields in my model that are not included in the ruleset. But that's by design. I don't want those fields to be displayed when users create or edit instances of this model.
I have already read this: https://github.com/flask-admin/flask-admin/pull/815#issuecomment-81963865
How can I suppress the warning?
You can suppress the warning when the view is added by using this snippet with the assumed name UserView:
import warnings
with warnings.catch_warnings():
warnings.filterwarnings('ignore', 'Fields missing from ruleset', UserWarning)
admin.add_view(UserView())
Reference: https://docs.python.org/2/library/warnings.html#warnings.filterwarnings

CakePHP get form query, Error: An Internal Error Has Occurred

I use get form for searching keywords. (CakePHP 2.2.5)
I see weird problems.
Firstly from CakePHP documentation : $foo = $this->request->query('value_that_does_not_exist'); give
Error: An Internal Error Has Occurred.
Method query does not exist
I tried that in both Controller and the view.
According to the manual it can be used to:
...read the url query array in an error free manner.
Btw,
$foo = $this->request->query['value_that_exist'];
works fine but I have to check it with “isset()“
Is it a CakePHP bug? I tested with fresh 2.2.5 install.
No, it is not a bug. The query() method was introduced in CakePHP 2.3.0-beta (see http://bakery.cakephp.org/articles/lorenzo/2012/10/28/cakephp_2_3_0-beta_released#cakerequest) and hence it is not available in CakePHP 2.2.5.

GWT set inner HTML giving Unknown runtime error

Please let me know what i am doing wrong here:
I need to add dynamic content to my htmy table using GWT.
I am using setInnerHTML method for this
Element tableElement=(Element) Document.get().getElementById("htmltable");
tableElement.setInnerHTML("<tr><td>1</td><td>2000</td><td>2</td><td>3000</td></tr>");
But i am getting this error
com.google.gwt.core.client.JavaScriptException: (Error): Unknown runtime error
number: -2146827688
description: Unknown runtime error
Please let me know what i am doing wrong here.
this can be due to multiple reasons.
If this is happening on IE only this post covers it: Debugging IE8 Javascript Replace innerHTML Runtime Error
In Ie you can not set the inner html of a table element.
From GWT CellTableImplementation for IE:
IE doesn't support innerHTML on tbody, nor does it support removing or
replacing a tbody. The only solution is to remove and replace the rows
themselves.