ModX gives me empty page of my document - modx

I have Document- "news", where are a lot of articles(children documents), if I click on some article, ModX gives me empty page with the current alias name in url. Error Log shows me
[2015-09-02 17:06:38] (ERROR # /index.php) Could not retrieve data to cache for resource 466
[2015-09-02 17:06:40] (ERROR # /index.php) Could not retrieve data to cache for resource 466
resource 466- this is my article. What can I do to solve this problem?
P.S. I have already deleted all cache files(by my hands). On my local server all is OK! Templates are the same on web server and on my local...
Thank you.

If these resources are static (binary files such as images, PDFs) try setting them uncached. I had the same issue and that fixed it for me.

Related

Azure copy data failed to read data from http server

I am new to ADF. I created an http linked service and it tested successfully (https://rebrickable.com/downloads/). On the http dataset properties page the same url address is in the Base URL. I then put just the file name that exists on that page (themes.csv.gz) in the Relative URL. When I click next to the File format settings page the Preview pane says:
Failed to read data from http server. Check the error from http
server:The remote server returned an error: (404) Not Found. The
remote server returned an error: (404) Not Found. . Activity ID:
0ca9f9c7-438d-461a-81c1-f81bacace4ca
What am I doing wrong please?
I also tried to create a new linked service and point it to my desktop files. I selected'File', left it at AutoresolveIntegrationruntime, put the path in Host. But don't know what do to with User/password. Please help
I hit the above mentioned end point in by browser : https://rebrickable.com/downloads/themes.csv.gz
Looks like the file is not existent at the mentioned location.
I did a quick scan of the page https://rebrickable.com/downloads
Encountered the below file :
Saw the file hyperlinked to this url (This is different from what you're attempting to in the ADF)
https://cdn.rebrickable.com/media/downloads/themes.csv.gz
I was able to download the file by using the above.
Would suggest you to try the above endpoint.
Update your url to https://cdn.rebrickable.com/media/downloads/ in https connection source

how to download references from task details in ms graph?

how to download references from task details in ms graph?
I have the following reference from a task detail (plannerTaskDetails resource type):
https://my_domain.sharepoint.com/sites/HR2/Shared Documents/2.csv?web=1
and I want to download the file but I get:
'401 UNAUTHORIZED'
I have the following delegated permissions:
https://graph.microsoft.com/Files.Read.All
https://graph.microsoft.com/Group.Read.All
https://graph.microsoft.com/Sites.Read.All
I do not know if I have to add another permission. Any help is appreciated.
The actual value of the reference is 'https%3A//my_domain%2Esharepoint%2Ecom/sites/HR2/Shared Documents/2%2Ecsv?web=1' to get the url I have used:
from urllib.parse import unquote
url = 'https%3A//my_domain%2Esharepoint%2Ecom/sites/HR2/Shared Documents/2%2Ecsv?web=1'
sp_url = unquote(url)
sp_url
# 'https://my_domain.sharepoint.com/sites/HR2/Shared Documents/2.csv?web=1'
If I put the URL in a browser where I'm logged in I can download the file.
You can't use this url format to download the file with Microsoft Graph. The access token is for Microsoft Graph but your url is for https://my_domain.sharepoint.com.
Please refer to Download a file.
You should use GET https://graph.microsoft.com/sites/{siteId}/drive/root:/{item-path}:/content.
It will return a 302 Found response redirecting to a pre-authenticated download URL for the file. This is the same URL available through the #microsoft.graph.downloadUrl property on the DriveItem.
Then you can use this download url to download the file.
But based on my latest test, /content doesn't work for me. I'm not sure if it works for you. So there is another method here.
In your case, I assume that HR2 is a subsite under my_domain.sharepoint.com.
Then the real requests should be:
Call GET https://graph.microsoft.com/v1.0/sites/my_domain.sharepoint.com/sites to list the subsites and find the id of "HR2".
Call GET https://graph.microsoft.com/v1.0/sites/{id of "HR2"}/drive/root:/2.csv.
In the response, there is a #microsoft.graph.downloadUrl property. You can directly use that url to download the file.
If HR2 is another site collection, the requests should be:
Call GET https://graph.microsoft.com/v1.0/sites/my_domain.sharepoint.com:/sites/HR2 to get the id of "HR2".
The subsequent steps are the same as subsite.

Google Site Verification Failure - HTML File Upload method

I have an Express/NodeJS app running on Google App Engine, for which I have the URL in the format of:
project-name.appspot.com, where project-name: My google project name
Now, for site verification, I am using HTML File Upload method.
I am serving the html verification file provided by google as follows:
res.sendFile(path.join(__dirname, path_to_html_file))
Now, when I enter the url: https://project-name.appspot.com/, I can view the file.
Also, the file has the same name as provided by Google.
However, when I click Verify in Webmaster, it still fails with error message "File not Found"
Can anyone point what I might be doing incorrectly ?
You need to serve this file from the /xxxxx.html url, not the root url.
In other words, it needs to be accessed from https://project-name.appspot.com/xxxxxxxx.html
Think about it... This file must stay up for as long as you want to be verified, so it doesn't make sense to be shown at the root url.
Also, make sure there are no redirects in serving this file.

php library for flickr API

I am banging my head trying to use Flickr API...
My goal is to be able to upload images and create albums in my Flickr account from my website...
I tried the phpFlickr library but apparently it needs updates for getting authenticated tokens...It keeps giving me "Invalid auth token".
I did some reading on how to get tokens and using DPZFlickr managed to get oauth_token & oauth_verifier but failed to exchange that with an access token...It also failed in uploading any photo to my account using the included upload.php example (Giving me an "empty" error!).
After digging in DBZ flickr.php code, I managed to get this error when trying to upload to Flickr: "oauth_problem=signature_invalid&"
So I began to search how to create a valid signature to eventually get a valid access token...and concluded that it is quite some work to be done here if I am going to build everything from scratch.
So my question is: Are there any updated php libraries that I can use to successfully create albums and upload photos to my Flickr account? Or should I go ahead and try building one?
OK..I finally got it to work with the DPZ library.
For future reference anybody facing the same problem as I had:
I managed to create an album using DPZFlickr by changing the method in auth.php to flickr.photosets.create....which indicated that the library correctly generates an access token with write permission..
However, the upload example kept giving me the "Invalid signature" error....
I checked the code. Flickr.php correctly unsets the photo parameter before signing the request then adds it back and submits the request which is exactly as indicated in: www.flickr.com/services/api/upload.api.html
I found a discussion in https://www.flickr.com/groups/51035612836#N01/discuss/72157650261711318/ that cleared out that the error was not actually a signature problem, but rather the 'photo' parameter that is being sent is the problem. It's just that Flickr doesn't know what to do with the photo parameter so it sends the signature error.
So what' wrong with the photo parameter?
Flickr API requires that the image has to be sent in binary form...The DBZ library, Flickr.php script line 677, does the hard work for us using the cURL function in php (http://au.php.net/manual/en/function.curl-setopt.php).
It sends the $parameters (which includes the uploaded photo) to the post field of the http request which should do the upload in binary format for us.
However, a brilliant comment I found in CURL PHP send image
states that:
"CURLOPT_SAFE_UPLOAD defaulted to true in 5.6.0... so you will need to add curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); before setting CURLOPT_POSTFIELDS"
Checking the manual: http://au.php.net/manual/en/function.curl-setopt.php
it says:
"Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0 changes the default value to TRUE."
So if your php version is 5.5.0 the library will work just fine whilst if using version PHP 5.6.0 you need to add a line before 677 in Flickr.php to change the CURLOPT_SAFE_UPLOAD to false (that's why the library works with some and others not).
To solve the issue...Just add this line before line 677 in Flickr.php:
curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false);
That's it. (-:

Uploading a file to SharePoint copyintoitems throws error

I am uploading files to SharePoint using the API Copy.CopyIntoItems. The upload works when the destination url is given as "http://sharepointserver/sitename". However, when the url is given with the domain name, like
"http://sharepointserver.domain/sitename", then the CopyIntoItems API call fails, and the error returned is "Object reference not set to an instance of an object".
Any idea on why there is a strange behavior when the url changes?
You can not use the url with the domain name, like "http://sharepointserver.domain/sitename" for Copying item
The following answer on SO links to a thread on MSDN, which explains in detail why this behaviour occurs: https://stackoverflow.com/a/2692212/274354
Link to the MSDN thread:
CopyIntoItems errors when using destination URI with FQDN

Resources