How to link to external and internal pages in React-VR? - webvr

I would like the ability for the user to click a button using the React-VR cursor and be able to go to external and internal pages like this
onEnter={() => Linking.openURL("https://www.google.com").catch(err => console.error('An error occurred', err))}
or
onEnter={() => Linking.openURL("paris.vr.js").catch(err => console.error('An error occurred', err))}
But I'm getting the following error
"Cannot read property 'openURL' of undefined"
Can someone help me out? Thanks!

Related

Laravel - Get error message from localized file

I'm creating my own validation and need to retrieve error messages from the localized file(resources/lang/en/validation.php and etc). The main task is to get array of error messages from the appropriate file. Usually, the validator does it and you don't need to worry about it. Does exist a way to get all these messages with no using validator?
You can access your translation files and their contents from anywhere with the global helper function trans
For example: your translations are in the file resources/lang/en/customvalidation.php
return [
'customerror' => 'my custom error message',
];
Then
trans('customvalidation.customerror')
will return "my custom error message" (depending on the current set language)

How to fix "Cannot read property 'apply' of undefined" trying to get the location using Protractor?

I'm trying to get an element's location using the Protractor (v6.0.0) method call getLocation(), however I'm getting the following exception:
TypeError: Cannot read property 'apply' of undefined
at <Jasmine>
at actionFn (/usr/lib/node_modules/protractor/built/element.js:95:44)
at <Jasmine>
at actionResults.getWebElements.then(/usr/lib/node_modules/protractor/built/element.js:468:44)
at <Jasmine>
at ElementArrayFinder.applyAction_(/usr/lib/node_modules/protractor/built/element.js:466:29)
Any clue how to resolve the issue?
Actually my code is really simple.
it('should compare login page with a baseline', async () => {
let input = element(by.id('mat-input-1'));
await input.getLocation();
});
I expect the coordinates of the input which has id mat-input-1, but unfortunately I'm getting that exception.
Protractor's CHANGELOG.md has a link to the selenium-webdriver CHANGELOG, it lists:
Changes for W3C WebDriver Spec Compliance
Replaced WebElement.getSize() and WebElement.getLocation() with a
single method, WebElement.getRect().
So it looks like you should use .getRect().
Now for Protractor 6 itself, this is clearly an issue with documentation. We recommend using 5.4.2 for now.

Find file that generated error CSRF TOKEN

I set up the handler file for whenever there is an error on the server, I receive an email with the details.
So today I received an email with the following error:
array (3) {["message"] => string (0) "" ["file"] => string (104)
"/var/www/infochat/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php"
["line"] => int (71)}
I know what this error is, but the problem is that I do not know what caused it, what file or code it was responsible for.
I did not find anything in the logs (I may have seen the wrong log). Is there somewhere I can check to find out?
There is absolutely no way to tell which file sent it if that's the only thing youre getting from the error stack on your email.
I'd get a cup of coffee, fire up the IDE and start doing a "Find all" for "

An error occurred while attempting to process /view/ajax: Cannot read property 'length' of undefined

Getting this error on a Drupal view exposed filter when i change the value on the select list. Tried every combination of jquery and jquery UI. Traced the call stack to misc/ajax.js:
Error
at alert (<anonymous>:4:15)
at Drupal.ajax.eventResponse (ajax.js?v=7.36:262)
at HTMLInputElement.<anonymous> (ajax.js?v=7.36:178)
at HTMLInputElement.dispatch (jquery.min.js?v=1.10.2:5)
at HTMLInputElement.v.handle (jquery.min.js?v=1.10.2:5)
at Object.trigger (jquery.min.js?v=1.10.2:5)
at HTMLInputElement.<anonymous> (jquery.min.js?v=1.10.2:5)
at Function.each (jquery.min.js?v=1.10.2:4)
at $.fn.init.each (jquery.min.js?v=1.10.2:4)
at $.fn.init.trigger (jquery.min.js?v=1.10.2:5)
i figured it out - it was some of my application code changing the array prototype. creating a "compare" array prototype basically breaks the ajax/views functionality.

How to use translations in Yii console application?

I have created a console Yii application that works as a background worker for a web app - it sends out emails and it needs to send them with translated messages.
For some reason however, the messages are not translated when using Yii::t
If I set the language to something else than english with Yii::app->setLanguage('et_ee'), and check that it is really changed with Yii::app->getLanguage() the texts are always in english.
When I run this same command from web, the texts are correctly translated.
I guess there must be something special I have to do for the translatiosn to work in a console application?
I have this error to. I dont know how is fix it. I am get lang array trow require('path/to/message/ru/message.php') in to var and use it. It is wrong, but it is work for me.
You need to specify the messages component in your console.php configuration
'messages' => array(
'class' => 'CDbMessageSource',
'forceTranslation'=>true,
'sourceMessageTable' => 'source_message',
'translatedMessageTable' => 'translated_message',
),
Just add string (For example - russian languages):
'language' => 'ru'
in config/console.php.

Resources