Moodle
  1. Moodle
  2. MDL-32221

Google Docs Repository doesn't show all files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.3
    • Component/s: Repositories
    • Labels:
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Rank:
      38997

      Description

      I'm trying to setup Google Docs access on my site.

      I'm able to login through the filepicker and see my Google Docs but not all files are showing up. Right now all I can see are pdf's.

      When uploading files to Google you are given the option to convert. If I don't convert all I see are pdf's. If I do use Google's convert I can then see Microsoft Word Docs as well as pdf's. Other files it takes and appends .rtf to the end. I don't see this in Google and only assume this is done by the filepicker.

      Is this a bug or is this supposed to be how it works. None of the documentation I have seen says what it should and should not show.

      1. googledocs.png
        42 kB
      2. googledocsconverted.png
        68 kB
      3. googledocsfixed.png
        49 kB

        Issue Links

          Activity

          Hide
          James Henestofel added a comment - - edited

          googledocs.png shows what my google docs has in it and what the filepicker shows

          Show
          James Henestofel added a comment - - edited googledocs.png shows what my google docs has in it and what the filepicker shows
          Hide
          James Henestofel added a comment - - edited

          googledocsconverted.png shows my google docs setup with the files converted using google's convert and what the file picker shows. Files that are not microsoft word files have .rtf appended. Not sure if thats google or the filepicker

          Show
          James Henestofel added a comment - - edited googledocsconverted.png shows my google docs setup with the files converted using google's convert and what the file picker shows. Files that are not microsoft word files have .rtf appended. Not sure if thats google or the filepicker
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that.

          I was able to reproduce this. The only file types I was able to see were documents, spreadsheets and presentations and these were provided with extensions .rtf, .xls and .ppt respectively. Other files in my Google docs storage were not shown.

          I've put that on the backlog.

          In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

          Show
          Michael de Raadt added a comment - Thanks for reporting that. I was able to reproduce this. The only file types I was able to see were documents, spreadsheets and presentations and these were provided with extensions .rtf, .xls and .ppt respectively. Other files in my Google docs storage were not shown. I've put that on the backlog. In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.
          Hide
          James Henestofel added a comment - - edited

          Michael,

          On my instance I was able to get the all the docs to show by adding a case for the types of files its looking for.

          In Moodle 2.1.5 (Build: 20120312) and the file at /lib/googleapi.php I added the following lines at line 322.

          case 'file':
          $title = (string)$gdoc->title;
          $source = (string)$gdoc->content[0] -> attributes() -> src;
          break;

          It just adds another case to look for in the google docs file system. All files that are not "Google Converted" Word docs or pdfs come through with the type as "file" which wasn't being checked for. I was able to add the files to my courses and view them just fine.

          Show
          James Henestofel added a comment - - edited Michael, On my instance I was able to get the all the docs to show by adding a case for the types of files its looking for. In Moodle 2.1.5 (Build: 20120312) and the file at /lib/googleapi.php I added the following lines at line 322. case 'file': $title = (string)$gdoc->title; $source = (string)$gdoc->content [0] -> attributes() -> src; break; It just adds another case to look for in the google docs file system. All files that are not "Google Converted" Word docs or pdfs come through with the type as "file" which wasn't being checked for. I was able to add the files to my courses and view them just fine.
          Hide
          James Henestofel added a comment -

          googledocsfixed.png shows that after the code I have above is added all the files now show up in the filepicker

          Show
          James Henestofel added a comment - googledocsfixed.png shows that after the code I have above is added all the files now show up in the filepicker
          Hide
          James Henestofel added a comment -

          Any progress on this issue. Will the patch I show above work for this?? We really need this and the provider we work with won't make changes like this and will only use the latest versions of moodle so they don't have to modify the core.

          Show
          James Henestofel added a comment - Any progress on this issue. Will the patch I show above work for this?? We really need this and the provider we work with won't make changes like this and will only use the latest versions of moodle so they don't have to modify the core.
          Hide
          Rob added a comment - - edited

          The file picker also does not display files of any type if they are placed in a collection (folder in Google Drive).

          Show
          Rob added a comment - - edited The file picker also does not display files of any type if they are placed in a collection (folder in Google Drive).
          Hide
          James Henestofel added a comment -

          Since the move to Google Drive. I can't get Google Docs to work at all anymore on our system. My guess is they have changed some stuff and this plugin needs to be modified further than what I have now.

          Show
          James Henestofel added a comment - Since the move to Google Drive. I can't get Google Docs to work at all anymore on our system. My guess is they have changed some stuff and this plugin needs to be modified further than what I have now.
          Hide
          Rob added a comment -

          Hi James,

          It is still working for me and the 30,000 users in my district. What do you see when you click the repository in the file picker?

          Show
          Rob added a comment - Hi James, It is still working for me and the 30,000 users in my district. What do you see when you click the repository in the file picker?
          Hide
          James Henestofel added a comment -

          I think I've figured out the issue. We just recently started using Google Apps for our institution for email and so on. When we did this we now need to register our site with google. Below is the error I get though and the page I searched and found what is likely wrong

          http://info.rjmetrics.com/blog/bid/44933/Google-Analytics-API-Snags-Malformed-Request-The-Site-Has-Not-Been-Registered

          The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows:

          The site "your site here" has not been registered.

          Show
          James Henestofel added a comment - I think I've figured out the issue. We just recently started using Google Apps for our institution for email and so on. When we did this we now need to register our site with google. Below is the error I get though and the page I searched and found what is likely wrong http://info.rjmetrics.com/blog/bid/44933/Google-Analytics-API-Snags-Malformed-Request-The-Site-Has-Not-Been-Registered The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows: The site "your site here" has not been registered.
          Hide
          Dan Poltawski added a comment -

          Hi, I believe issues such as this should be resolved by the linked issue.

          Show
          Dan Poltawski added a comment - Hi, I believe issues such as this should be resolved by the linked issue.
          Hide
          James Henestofel added a comment -

          Hi Dan,
          I noticed you removed the Fix Version 'MUST FIX FOR 2.3' from this issue. Does that mean you aren't looking at this as a must fix anymore because this causes big issues for our institution and this really needs fixed for us.

          Show
          James Henestofel added a comment - Hi Dan, I noticed you removed the Fix Version 'MUST FIX FOR 2.3' from this issue. Does that mean you aren't looking at this as a must fix anymore because this causes big issues for our institution and this really needs fixed for us.
          Hide
          Dan Poltawski added a comment -

          Hi James,

          No. I have just taken it off the backlog of things to be done as its already address in the linked issue.

          Show
          Dan Poltawski added a comment - Hi James, No. I have just taken it off the backlog of things to be done as its already address in the linked issue.
          Hide
          Dan Poltawski added a comment -

          To be clear: yes this will be fixed in 2.3 along with the OAuth plugins.

          Show
          Dan Poltawski added a comment - To be clear: yes this will be fixed in 2.3 along with the OAuth plugins.
          Hide
          James Henestofel added a comment -

          Dan,
          Checked the git repository for 2.3 and this looks fixed. Doesn't looked fixed though for MOODLE_22_STABLE. Is the fix applied to 2.3 going to be done for 2.2?

          Show
          James Henestofel added a comment - Dan, Checked the git repository for 2.3 and this looks fixed. Doesn't looked fixed though for MOODLE_22_STABLE. Is the fix applied to 2.3 going to be done for 2.2?
          Hide
          Dan Poltawski added a comment -

          Sorry James, no this new feature is going to be in 2.3 and above only.

          Show
          Dan Poltawski added a comment - Sorry James, no this new feature is going to be in 2.3 and above only.

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: