Hi everyone,
I'm trying to port some web services in digiKam export tool to OAuth2 with O2 library for qt. Testing new codes for Facebook, I got stuck with this error QNetworkReply::NetworkError(ContentAccessDenied) when trying to post photos on Facebook or create new albums. However, I can still login, load existant album, except posting something with POST request (using QNetworkRequest). This error is quite strange because the codes do require user permission for user_photo, publish_pages and manage_pages as instruction in Facebook Graph API documentation, so I don't understand why QNetworkReply reports Content Access Denied error. So, does someone have any suggestions, ideas or guidance for this case? I really appreciate any help. Thanks a lot, Thanh-Trung Dinh -- Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html |
Thanh,
can you provide a patch so I can test it? Maik Am Montag, 21. Mai 2018, 17:14:44 CEST schrieb Thanh Trung Dinh: > Hi everyone, > > I'm trying to port some web services in digiKam export tool to OAuth2 with > O2 library for qt. > > Testing new codes for Facebook, I got stuck with this error > QNetworkReply::NetworkError(ContentAccessDenied) when trying to post photos > on Facebook or create new albums. However, I can still login, load existant > album, except posting something with POST request (using QNetworkRequest). > This error is quite strange because the codes do require user permission for > user_photo, publish_pages and manage_pages as instruction in Facebook Graph > API documentation, so I don't understand why QNetworkReply reports Content > Access Denied error. > > So, does someone have any suggestions, ideas or guidance for this case? I > really appreciate any help. > > Thanks a lot, > Thanh-Trung Dinh > > > > -- > Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html |
Yes Maik. Here is the patch. o2fb.patch
<http://digikam.1695700.n4.nabble.com/file/t376575/o2fb.patch> -- Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html |
In reply to this post by Thanh Trung Dinh
Hi Thanh,
first of all the good news your code works. The bad news, Facebook has disabled digiKam because it has not been reviewed yet. But we need to show a finished uploader first. I have under https://developers.facebook.com put digiKam back into developer mode. You can find the test user under Roles, only with these you can work. For example, "Dick Albfbdhiehefa Dingleson" You can log in as this user and now start digiKam, this user should now appear in digiKam. Maik Am Montag, 21. Mai 2018, 17:14:44 CEST schrieb Thanh Trung Dinh: > Hi everyone, > > I'm trying to port some web services in digiKam export tool to OAuth2 with > O2 library for qt. > > Testing new codes for Facebook, I got stuck with this error > QNetworkReply::NetworkError(ContentAccessDenied) when trying to post photos > on Facebook or create new albums. However, I can still login, load existant > album, except posting something with POST request (using QNetworkRequest). > This error is quite strange because the codes do require user permission for > user_photo, publish_pages and manage_pages as instruction in Facebook Graph > API documentation, so I don't understand why QNetworkReply reports Content > Access Denied error. > > So, does someone have any suggestions, ideas or guidance for this case? I > really appreciate any help. > > Thanks a lot, > Thanh-Trung Dinh > > > > -- > Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html |
Thanh, Did you create a development branch in git repository for your project. I recommend to commit step by step your progress, this will be used later to make the final report to Google. Currently, we have these branches in git repository : [gilles@localhost core]$ pwd /mnt/data/6.x/core [gilles@localhost core]$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/development/0. remotes/origin/development/0. remotes/origin/development/0. remotes/origin/development/0. remotes/origin/development/1. remotes/origin/development/1. remotes/origin/development/3. remotes/origin/development/6. remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/development/ remotes/origin/gsoc11-clone remotes/origin/gsoc11- remotes/origin/gsoc13- remotes/origin/gsoc13- remotes/origin/gsoc13- remotes/origin/gsoc13-tagmngr remotes/origin/gsoc13- remotes/origin/gsoc13-videow remotes/origin/gsoc14-greyc remotes/origin/gsoc14-kipibqm remotes/origin/gsoc14-qaccess remotes/origin/gsoc15- remotes/origin/gsoc15-kio- remotes/origin/gsoc16-mysql remotes/origin/gsoc16-red-eye remotes/origin/gsoc17-db-sep remotes/origin/gsoc17-dlna remotes/origin/gsoc17-face- remotes/origin/gsoc17-healing remotes/origin/master [gilles@localhost core]$ You will need to create a branch named "remotes/origin/gsoc18- Best 2018-05-22 19:56 GMT+02:00 Maik Qualmann <[hidden email]>: Hi Thanh, |
@Maik, it's good to hear that my code worked. Thank you for your help. I will test this evening and do the app review for Facebook. @Gilles, no I didn't. I still do git stash each time, but it's quite annoying and not a permanent way to commit. I'll do it this evening. On Tue, May 22, 2018 at 11:46 PM, Gilles Caulier <[hidden email]> wrote:
-- Mr. Thanh-Trung Dinh Université de Technologie de Compiègne (UTC) - France Tel: +33 7 53 68 20 29 |
See this link to an older GSoC event where i write some guidance about basis git operations to do by students : Gilles 2018-05-23 8:58 GMT+02:00 Thanh Trung Dinh <[hidden email]>:
|
Gilles, So I followed the link you give above and when I push the new local branch, there's an error " fatal: remote error: service not enabled: /digikam.git ". So I don't know if it's me that made an error or it's something that was not enabled yet in digiKame git server? On Wed, May 23, 2018 at 9:50 AM, Gilles Caulier <[hidden email]> wrote:
-- Mr. Thanh-Trung Dinh Université de Technologie de Compiègne (UTC) - France Tel: +33 7 53 68 20 29 |
I hope that you don't checkout the repository in read only, but in RW of course. You need to use ssh access to git. Look url given here : git clone [hidden email]:digikam ./6.X Look also the git settings to do in this README file before to checkout code : Gilles 2018-05-23 22:39 GMT+02:00 Thanh Trung Dinh <[hidden email]>:
|
So I actually did checkout the read only repository ...! However, I resolved it now and pushed all changes to the new branch :-). On Wed, May 23, 2018 at 10:45 PM, Gilles Caulier <[hidden email]> wrote:
-- Mr. Thanh-Trung Dinh Université de Technologie de Compiègne (UTC) - France Tel: +33 7 53 68 20 29 |
I see your commit. there is a notification mailing list. great Gilles 2018-05-24 0:57 GMT+02:00 Thanh Trung Dinh <[hidden email]>:
|
Gilles, Maik,
I have to reopen this post again, since I got a problem here again with Facebook for a week and this may affect the 6.0.0 beta release. The problem is that now I cannot create albums on Facebook via digiKam a anymore. Back to 22 May, when Maik tested my code for the first time, an album name "Test2018" was created normally on test user "Dick Albfbdhiehefa Dingleson". After that I created some other to test and then deleted them. I was also able to upload photos to those albums, and to no album (indeed an album name "digiKam photos" will be created automatically if no album is assigned to uploaded photos). But now, I cannot create albums anymore. Each time doing that, I got the error "/content access denied/" again. When inspecting json response from API call, the error message is "/(#200) Insufficient permission to create album/" However, thing is stranger when I can still upload photos to existant albums, and to no album as well. Tracking down commits from 22 May, after the first 2 commits that I made many changes in fbtalker.cpp, other commits were mostly about polish or some minor modifications. In fact, because of that problem, I can't finish app review. Therefore, Facebook export tool will not be able to be used in public mode (for users not tester, admin, etc.). So, Gilles, Maik, could you please review my code for Facebook tool? It's still possible that I made mistakes in codes. Otherwise, do you have any ideas, suggestions about that problem? Many thanks. Thanh -- Sent from: http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html |
I started to run static analyzers over your branch. cppcheck results are here : Look especially the reports located in core/utilities/assistants/... Take a care, sometimes cppcheck report false errors, sometimes, no (:=)))... You can forget all others place where i already fixed all most important reports. I run now clang tool, which come generally with better results. Gilles 2018-06-17 2:21 GMT+02:00 Thanh Trung Dinh <[hidden email]>: Gilles, Maik, |
This is the clang static analyzer report : Gilles 2018-06-17 10:32 GMT+02:00 Gilles Caulier <[hidden email]>:
|
Look the krazy report here :
This part is for you : Check single-char QString operations for efficiency [doublequote_chars]...OOPS! 14 issues found!
Adding single characters to a QString is faster if the characters are QChars and not QStrings. For example: QString path = oldpath + "/" + base is better written as QString path = oldpath + '/' + base. Same holds for arguments to QString::startsWith(), QString::endsWith(), QString::remove(), QString::split(). Use QString::remove() instead of QString::replace(foo,"") Gilles |
So for clang and cppcheck I didn't see problems that really matter in my part. For krazy, I fixed those by changing them to QLatin1Char Is it correct? Thanh. On Sun, Jun 17, 2018 at 3:06 PM, Gilles Caulier <[hidden email]> wrote:
-- Mr. Thanh-Trung Dinh Université de Technologie de Compiègne (UTC) - France Tel: +33 7 53 68 20 29 |
yes it is. There is also this one :
Gilles 2018-06-17 15:33 GMT+02:00 Thanh Trung Dinh <[hidden email]>:
|
Hi Thanh,
I have already looked very deeply and can find no error in the implementation. At the moment I do not know why access is denied. I stay tuned. Maik Am Sonntag, 17. Juni 2018, 16:49:49 CEST schrieb Gilles Caulier: > yes it is. > > There is also this one : > > > 1. Check for spelling errors [spelling]...*OOPS! 2 issues found!* > - /core/utilities/assistants/webservices/facebook/fbtalker.cpp > > <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/assis > tants/webservices/facebook/fbtalker.cpp>: > /core/utilities/assistants/webservices/facebook/fbtalker.cpp - > /core/utilities/assistants/webservices/facebook/fbtalker.cpp > <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/assis > tants/webservices/facebook/fbtalker.cpp>: line# 101 > > <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/assis > tants/webservices/facebook/fbtalker.cpp#0101>[[neccessary]] (1) > > Spelling errors in comments and strings should be fixed as they may show > up later in API documentation, handbooks, etc. Misspelled strings make > the translator's job harder. Please use US English. > 2. > > > Gilles > > 2018-06-17 15:33 GMT+02:00 Thanh Trung Dinh <[hidden email]>: > > So for clang and cppcheck I didn't see problems that really matter in my > > part. > > > > For krazy, I fixed those by changing them to QLatin1Char Is it correct? > > > > Thanh. > > > > On Sun, Jun 17, 2018 at 3:06 PM, Gilles Caulier <[hidden email]> > > > > wrote: > >> Look the krazy report here : > >> > >> https://www.digikam.org/reports/krazy/gsoc18-exporttools-o2/ > >> > >> This part is for you : > >> > >> Check single-char QString operations for efficiency > >> [doublequote_chars]...*OOPS! 14 issues found!* > >> > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: => data += "{"; > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: => data += "{"; > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: => data += "}"; > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: => data += "}"; > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: => data += ","; > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: => data += "]"; > >> - /core/utilities/assistants/webservices/google/gphoto/gptalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp>: line# 678 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp#0678> ,695 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp#0695> ,701 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp#0701> ,702 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp#0702> ,705 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp#0705> ,710 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/google/gphoto/gptalker.cpp#0710>>> > >> (6) > >> > >> - /core/utilities/assistants/webservices/smugmug/smugtalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/smugmug/smugtalker.cpp>: => QStringList words = > >> n.split(" "); > >> - /core/utilities/assistants/webservices/smugmug/smugtalker.cpp > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/smugmug/smugtalker.cpp>: split issues line# 324 > >> <http://lxr.kde.org/source/extragear/graphics/digikam//core/utilities/ > >> assistants/webservices/smugmug/smugtalker.cpp#0324>>> > >> (1) > >> > >> Adding single characters to a QString is faster if the characters are > >> QChars and not QStrings. For example: QString path = oldpath + "/" + base > >> is better written as QString path = oldpath + '/' + base. Same holds for > >> arguments to QString::startsWith(), QString::endsWith(), > >> QString::remove(), > >> QString::split(). Use QString::remove() instead of > >> QString::replace(foo,"") > >> Gilles > > > > -- > > Mr. Thanh-Trung Dinh > > Université de Technologie de Compiègne (UTC) - France > > Tel: +33 7 53 68 20 29 |
Free forum by Nabble | Edit this page |