Directus - AWS S3 Upload - error message: Cannot set property 'value' of undefined - amazon-s3

I just set up directus with s3 storage like this: https://docs.directus.io/extensions/storage-adapters.html#core-adapters
It seems to be working: but there is one issue:
When I upload an image, it gives me an error: Cannot set property "value" of undefined
But when I refresh the page, all is done and it seems to be fine. The files are on s3 and I can see it in my admin panel. But the error message and the need to refresh the page sucks - especially when it comes to give it to my clients.
Is it possible that this could be a bug in the source code of directus?
But when its like that, why I am the only person having this issue ... ?
Here are my config details:

It could be a bug... perhaps related to a migrations issue (which would be why it's not seen by more people). You could open a ticket on GitHub and the developers will check it out. Just try to make sure it's not a config issue first. :)

Related

"User is unauthorized" error with sample web viewer app

I'm following the instructions here: https://www.itwinjs.org/learning/tutorials/develop-web-viewer/ to create a sample web viewer app. The doc says to update variable IMJS_CONTEXT_ID which is not in the .env file and doesn't appear with "Show IDs" for my iModel (I have created a github issue for the doc already). I've tried updating the variable IMJS_ITWIN_ID instead with the "iTwin ID" from my iModel. When I start the app I get an error page "An Error Has Occurred: The user is unauthorized. Please provide valid authentication credentials". I have checked the variables IMJS_AUTH_CLIENT_CLIENT_ID, IMJS_AUTH_CLIENT_REDIRECT_URI, IMJS_AUTH_CLIENT_SCOPES, IMJS_ITWIN_ID, IMJS_IMODEL_ID and all appear to be correct. Is there something else I need to configure?
Sorry, the tutorial you're referring to is a bit outdated now. Have you taken a look at https://developer.bentley.com/tutorials/web-application-quick-start/?
In the new #itwin/web-viewer-react templates we renamed IMJS_CONTEXT_ID to IMJS_ITWIN_ID. We also made some changes to the required scopes, you'll need namely imodelaccess:read, imodels:read, and realitydata:read. Please make sure your auth client has the above scopes and you have access to the model. If you still have trouble, feel free to continue the discussion over at https://github.com/iTwin/itwinjs-core/discussions

Changing fine uploader s3 policy error messages

Is there a way to change the invalid S3 policy error messages displayed to the user with FineUploader? I've found how to customise the others, but I can't find reference to this in the JS so I'm assuming the message is sent from S3. Is there a way of intercepting the message and replacing it with something more meaningful?
Thanks,
Chris
No, there isn't anything in place to adjust this message, mostly due to the fact that this is not an issue a user can fix. If there is a specific adjustment you'd like to see in future versions, please open up a case in the GitHub project's issue tracker.

Prestashop : SmartyException' with message 'unable to write file...'

I know this subject has already been covered, and if I come to ask for help here, it's because all the solutions I've found on the Internet didn't work for me.
The problem is the following :
I'm using Prestashop 1.6. I developed my website locally and everything worked just fine, so I decided to put it online. But after moving the database and the website on my FTP, I am encountering the following error :
Uncaught exception 'SmartyException' with message 'unable to write file /home/web/chienchat/cache/smarty/compile/wrt53fc8900660ea3.68556794' in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php:44
Stack trace:#0 /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/web/chien...', 'compileTemplateSource() #2 /home/web/chienchat/classes/module/Module.php(1860): Smarty_Internal_TemplateBase->fetch()#3 /home/web/chienchat/modules/blockuserinfo/blockuserinfo.php(72): ModuleCore->display('/home/web/chien...', 'blockuserinfo.t...')#4 /home/web/chienchat/classes/Hook.php(507): BlockUserInfo->hookDisplayTop(Array) #5 /home/web/chienchat/classes/controller/FrontController.php(444): HookCore::exec('displayTop') #6 /home/web/chienchat/controllers/front/IndexController.php(37): F in /home/web/chienchat/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44
I found it could be the file permissions, so for the sake of testing I've set CHMOD 777 on the whole www, by using FileZilla. The problem is still here.
I would like to point out that after deleting the cache/smarty folder, and after refreshing the non-working page, the folder cache/smarty/compile is anew created, but it is empty. Please help me, I can't seem to approach any solution.
The correct permission is 755. If this does not work try with 775.
Also the apache user must be the owner of the required folders.
The folders are listed here:
http://doc.prestashop.com/display/PS15/Installing+PrestaShop#InstallingPrestaShop-Systemcompatibility
This error can also occur if you use the filesystem cache. Many of the prestashop plugins are written in a way that causes a cache miss and store for lots of combinations of each page (page name, category name, language etc.) If you have a large number of products this can mean that you run over the Inode limit for the cache folder and you'll start to see this error, but only on first time visits to pages. Pages that were already in the cache will still render properly.
The solutions in this case are to
a) clear the cache
b) fix all the cache ids for every module
c) use an alternative caching strategy
A warning for c however - it doesn't fix the problem as the cache is still growing. It just takes away the filesystem limits on how many cache items you can hold. The best I can suggest for those suffering this problem is to automatically tail the log and clear the cache when this error occurs.

401 Unauthorized access when posting Google+ Moments with PHP Client

I'm trying to post a moment in google+ using the API, creating a simple example, but I get a 401 error. I'm following Silvano Luciani steps from https://plus.google.com/+SilvanoLuciani/posts/2kMX9Dzaf8V, and in order to post a moment, I've:
Downloaded the last library, 0.6.1 from here: https://code.google.com/p/google-api-php-client/downloads/list
Downloaded example from Silvano Luciani: https://gist.github.com/silvolu/5054214
Configured the example file with all the data from my G+ App
This directly doesn't work, in the example, in line 16, is asking for a class Google_PlusService, and it doesn't exist, so I changed it for the class Google_PlusMomentsService.
With the change, it posted to a URL that is something like 'plus/v1moments/people/' and it shows 404 error. So, I modified the URL in src/contrib/Google_PlusMomentsService.php, line 73 from "plus/v1moments/people" => to "plus/v1/people".
After that, it shows that it requires setRequestVisibleActions to work, and I realized the Google Client hasn't the method, so I take the last Google_client from the Google repo here: https://code.google.com/p/google-api-php-client/source/detail?r=534
Ok, now, it works but it shows a 401 error and I don't know how to follow.
The error is:
Error calling POST https://www.googleapis.com/plus/v1/people/me/moments/vault?key=XXXXXXXXXXXXXX: (401) Unauthorized in C:\wamp\www\gPlus\src\io\Google_REST.php on line 66
Where XXXXXXXXXX key is my developer key set in the file. It looks like the POST is not including the actions in the URL, but I'm not sure if this is the problem or how to solve it. Has anyone any idea of how to solve it? Thanks!
Update
As Luciano is pointing, I'm using an obsolete google-php-client, so, as he indicates, I've downloaded from the SVN repo the last code. But after setting the configuration files, include the moments example file from Silvano in moments and configure the API redirects URL in the Google console and the config files, the examples in /examples folder are not working. Executing Silvano PHP example it's throwing a "Not available" error:
Esta página web no está disponible
Es posible que la página web https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%2FgplusAPI%2Fexamples%2Fmoments%2Findex.php&client_id=xxxxxxxx.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login&access_type=offline&approval_prompt=force&request_visible_actions=http%3A%2F%2Fschemas.google.com%2FAddActivity+http%3A%2F%2Fschemas.google.com%2FReviewActivity esté temporalmente inactiva o que se haya trasladado definitivamente a otra dirección.
Error 15 (net::ERR_SOCKET_NOT_CONNECTED): Error desconocido.
But also the same error with the other examples in the library. A temporal problem, or a library problem?
Update 2
Yeah, it was a browser problem. It still appearing in Chrome, but using Firefox is working like a charm, it doesn't appears 401 error anymore, which is good, XD
Now, I have another problem, it gives back an array but it doesn't publish anything in the stream. Silvano, is this normal? Anyway, thank you very much for your help, my main question is answered, another step less to accomplish stream publishing, XD!
The array is:
Array (
[kind] => plus#moment
[type] => http://schemas.google.com/AddActivity
[target] => Array (
[kind] => plus#itemScope
[url] => https://developers.google.com/+/plugins/snippet/examples/thing
)
[result] => Array (
[kind] => plus#itemScope
)
[id] => xxxxxxxxx
)
Update 3
Ok, It looks that to prevent spam they don't allow post directly on stream. See the answer of this question for more info:
Post in Google+ stream is not showing up in user's stream using google-api-PHP-client
You need to use the version of the library that you can find in trunk for the code shown in the gist to work.
You shouldn't use Google_PlusMomentsService, because it has been deprecated (and it's removed from trunk). It's strange that Google_PlusService doesn't exist, it's here.

How to load a static google map with a path (polyline)?

I have implemented some code that loads an image from a URL upon a listview item being clicked; this has been tested with a 'dummy' image and works without any problem with the image being displayed in an imageview object.
However, what I really want to do is to load a Static Google Map with Paths (polyline) via URL, but for some reason this is not working and I hope that someone here will be able to tell me what is wrong with my URL:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397
According to the Google documentation http://code.google.com/apis/maps/documentation/staticmaps/ I believe that my URL should work, because an image witha path only requires the size attribute (i.e. all others are optional).
When I try to test load my URL via a web-browser I receive an Error 403 in Google Chrome telling me that the googleapis website requires a log in. Is this the API key? I have an API key that I've previously used for a non-static google map and I copy/pasted this key from the map's xml into my URL (using the key= attribute), but again this was not successful.
I've tried searching on google and this forum, but it seems that no-one has had this problem before - or maybe I'm just really bad at searching :( But hopefully someone can assist?
Thanks!
You're missing the required sensor parameter.
http://maps.googleapis.com/maps/api/staticmap?size=400x400&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397&sensor=false
This requirement is fairly new, but yes, you are missing the API key.
Just as you added the parameters &size= or &path=, at some point you need to have a &key=parameter. So for your example it would look like this:
http://maps.googleapis.com/maps/api/staticmap?size=400x400&key=ENTER-YOUR-API-KEY&path=40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397
hope that helps