Uncaught Error: Syntax error, unrecognized expression: option[] - spring

When I try to add a selector and then pick an option, the script errors.
<form:select propertyContainer="${searchCriteria}" id="macroconditions" liveSearch="true" name="macroconditions" propertyPath="macroconditions" convertsToAccordion="true"/>
The log shows:
Uncaught Error: Syntax error, unrecognized expression: option[value=text of the selector]
SearchCriteria Script:
private EclMacroconditionCollection macroconditions;
public EclMacroconditionCollection getMacroconditions() {
if (macroconditions == null){
macroconditions = new EclMacroconditionCollection(EclMacrocondition.class);
Object period = getValueFromCookie(getPeriod());
macroconditions.getMacroconditions(period == null ? null : period.toString());
}
return macroconditions;
}
public void setMacroconditions(EclMacroconditionCollection macroconditions) {
this.macroconditions = macroconditions;
}
thanks

Related

Using this.skip with cypress-json-failed results in: TypeError: Cannot read properties of undefined (reading 'message')

I am attempting to use a global beforeeach() algorithm defined in support/e2e to filter tests. This code works.
beforeEach(function () {
var testSuite = new Array();
testSuite = (Cypress.env('suites'));
if (!testSuite) {
return;
}
const testName = Cypress.mocha.getRunner().test.fullTitle().toLowerCase();
let matches = testSuite.some((value) => {
return (testName.includes(value))
});
if (!matches) {
this.skip();
}
return;
})
However, when using in conjunction with cypress-failed-log, tests that are skipped because of the prior algorithm are failing with this error:
TypeError: Cannot read properties of undefined (reading 'message')
Because this error occurred during a `after each` hook we are skipping all of the remaining tests.
at Context.onFailed (webpack:///./node_modules/cypress-failed-log/src/index.js:136:0)
This is what my plug in looks like. It works independent of the sorting algorithm and fails with the same message even if I only leave just the failed:required line and remove the code that uses the message object.
on('task', {
failed: require('cypress-failed-log/src/failed')()
,
log(message) {
console.log(message)
return null
},
table(message) {
console.table(message)
return null
}
})

Near Protocol: Error during Context.predecessor in view

I'm trying to get sender accountId in contract and getting error.
My contract:
#nearBindgen
export class Contract {
private message: string = 'Hello '
helloWorld(): string {
const predecessor = Context.predecessor
return this.message + predecessor
}
}
I'm trying to access contract from CLI with following command(with my account id):
near view $CONTRACT helloWorld --accountId <id>.testnet
Error:
Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(HostError(ProhibitedInView { method_name: "predecessor_account_id" })).
Oops. I should use
near call
instead of
near view

ERROR : syntax error, unexpected '$app' (T_VARIABLE), expecting ')'

Found in [consoletvs\charts\src\ChartsServiceProvider.php]
Error
Found this error.. any ideas ?
The error is very clear, it tells you that you are missing one ) after your $app variable.
Try this :
public function register(): void {
$this->app->singleton(Registrar::class, fn(Application $app)) => new Registrar (
//...
);
}

How can I run from exception and receive false in this case

I have this code
function checkIBAN($iban)
{
$iban = strtolower(str_replace(' ','',$iban));
$Countries = array('al'=>28,'ad'=>24,'at'=>20,'az'=>28,'bh'=>22,'be'=>16,'ba'=>20,'br'=>29,'bg'=>22,'cr'=>21,'hr'=>21,'cy'=>28,'cz'=>24,'dk'=>18,'do'=>28,'ee'=>20,'fo'=>18,'fi'=>18,'fr'=>27,'ge'=>22,'de'=>22,'gi'=>23,'gr'=>27,'gl'=>18,'gt'=>28,'hu'=>28,'is'=>26,'ie'=>22,'il'=>23,'it'=>27,'jo'=>30,'kz'=>20,'kw'=>30,'lv'=>21,'lb'=>28,'li'=>21,'lt'=>20,'lu'=>20,'mk'=>19,'mt'=>31,'mr'=>27,'mu'=>30,'mc'=>27,'md'=>24,'me'=>22,'nl'=>18,'no'=>15,'pk'=>24,'ps'=>29,'pl'=>28,'pt'=>25,'qa'=>29,'ro'=>24,'sm'=>27,'sa'=>24,'rs'=>22,'sk'=>24,'si'=>19,'es'=>24,'se'=>24,'ch'=>21,'tn'=>24,'tr'=>26,'ae'=>23,'gb'=>22,'vg'=>24);
$Chars = array('a'=>10,'b'=>11,'c'=>12,'d'=>13,'e'=>14,'f'=>15,'g'=>16,'h'=>17,'i'=>18,'j'=>19,'k'=>20,'l'=>21,'m'=>22,'n'=>23,'o'=>24,'p'=>25,'q'=>26,'r'=>27,'s'=>28,'t'=>29,'u'=>30,'v'=>31,'w'=>32,'x'=>33,'y'=>34,'z'=>35);
try{
$cntr=(in_array(substr($iban,0,2),$Countries)) ? $Countries[substr($iban,0,2)] : false;
if(strlen($iban) == $cntr){
$MovedChar = substr($iban, 4).substr($iban,0,4);
$MovedCharArray = str_split($MovedChar);
$NewString = "";
foreach($MovedCharArray AS $key => $value){
if(!is_numeric($MovedCharArray[$key])){
$MovedCharArray[$key] = $Chars[$MovedCharArray[$key]];
}
$NewString .= $MovedCharArray[$key];
}
if(bcmod($NewString, '97') == 1)
{
return TRUE;
}
else{
return FALSE;
}
}
else{
return FALSE;
}
}catch (Exception $e) {
report($e);
return false;
}
}
And I receive this exception in Laravel
{message: "Undefined offset: 21", exception: "ErrorException",…}
exception
:
"ErrorException"
"Undefined offset: 21" in this string $Countries[substr($iban,0,2)]
How can I run from Exception and receive just a false in this case? Because of that fact that my function which is checking iban must receive only true or false not an Exception. If I receive an Exception that is 500error in Ajax
There are quite a few tested iban validation libraries on the packagist.
https://packagist.org/?q=iban&p=0
I'd use one of these instead.
Much better than some crusty code copied off another stackoverflow question.
A "ErrorException" is laravel's error handler turning a php error into an exception. You can avoid the error by adding checks before doing array access.
Consider this example:
$MovedCharArray[$key] = $Chars[$MovedCharArray[$key]];
It assumes that $MovedCharArray has an index of $key and assumes that $Chars has an index of $MovedCharArray[$key]. If any of those don't exist, you'll get that error.
Add some checks before attempting to access those array elements and you can avoid the error.
if(isset($MovedCharArray[$key]) && isset($Chars[$MovedCharArray[$key]])){
$MovedCharArray[$key] = $Chars[$MovedCharArray[$key]];
}else{
//Some error condition you'll need to deal with.
}

org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [] [CALL usp_LoginDetails(?, :p_login)]

I am trying my best but i am not able to resolve this error please help me.
DaoImplimentation file:
#Override
public LoginProcedure getLoginProcedureByNamedQuery(String p_login) {
try {
Query lquery = getHibernateTemplate().getSessionFactory().openSession().getNamedQuery("dd");
lquery.setParameter("p_login", p_login);
List ll= lquery.list();
System.out.println("value of ll"+ll);
}
}catch(Exception e){
e.printStackTrace();
}
return null;
}
Hbm file :
<![CDATA[CALL usp_LoginDetails(?, :p_login)]]>
</sql-query>
Error coming :
2015-09-18 18:06:05,769 ERROR [stderr] (default task-31) org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [] [CALL usp_LoginDetails(?, :p_login)]
On your hbml file can you try the following syntax:
<sql-query callable="true"
name="dd">{call usp_LoginDetails(:p_login)}
<query-param name="p_login" type="string"/>
</sql-query>

Resources