Issue #3 resolved

Pagedown changes upload behaviour

Eli Bressert
created an issue

When Mezzanine-pagedown (latest dev clone) is installed and used in a Mezzanine project (version 1.3 | Django version 1.4.3) images cannot me uploaded through the admin interface. I was able to reproduce this on two computers by creating a fresh Mezzanine project and initialising Mezzanine-pagedown. When the app is removed from settings.py, the uploads work without a problem.

-Eli

Comments (17)

  1. Ahmad Khayyat repo owner

    I could not reproduce this problem!

    In a new virtualenv, I did the following:

    > pip install mezzanine
    > hg clone https://bitbucket.org/akhayyat/mezzanine-pagedown
    > pip install ./mezzanine-pagedown/
    > mezzanine-project mezztest
    

    Then, in settings.py, I added mezzanine_pagedown to INSTALLED_APPs, and added the following two lines:

    RICHTEXT_WIDGET_CLASS = 'mezzanine_pagedown.widgets.PageDownWidget'
    RICHTEXT_FILTER = 'mezzanine_pagedown.filters.codehilite'
    

    Finally, I ran the following in the mezztest directory:

    > python manage.py createdb --noinput
    > python manage.py runserver
    

    This resulted in a site that I could upload to in the Media Library section of the site (http://localhost:8000/admin/media-library/browse/).

    Here is the pip freeze -l output for the used virtualenv:

    Django==1.4.3
    Markdown==2.2.1
    Mezzanine==1.3.0
    bleach==1.1.5
    distribute==0.6.24
    filebrowser-safe==0.2.14
    grappelli-safe==0.2.11
    html5lib==0.95
    mezzanine-pagedown==0.1
    pytz==2012j
    

    I managed to upload an image to the existing gallery folder, create a new folder, and upload another image in the new folder, all without any issues.


    Are you getting any messages from the server process or in the browser?

  2. Eli Bressert reporter

    Thanks for the reply. I ran through the steps you did with virtualenv and I could still reproduce the problem. Here's my pip freeze -l output:

    Django==1.4.3
    Markdown==2.2.1
    Mezzanine==1.3.0
    Pillow==1.7.8
    bleach==1.1.5
    filebrowser-safe==0.2.14
    grappelli-safe==0.2.11
    html5lib==0.95
    mezzanine-pagedown==0.1
    pytz==2012j
    

    I must admit that it is strange that you cannot reproduce while I can while using virtualenv. I'll try to do the same setup tomorrow on another computer. Will give an update then (I'm on Oz time).

  3. Nate Aune

    I think I'm having the same problem, but it only seems to occur when using django-storages (as that is a requirement for deploying Django apps to Heroku where you want to persist uploaded files).

    I can invoke the same error when going to the Mezzanine media library (http://www.coderaising.org/admin/media-library/browse/)

    Environment:
    
    
    Request Method: GET
    Request URL: http://www.coderaising.org/admin/media-library/browse/
    
    Django Version: 1.4.3
    Python Version: 2.7.3
    Installed Applications:
    ['mezzanine.boot',
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.redirects',
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.sitemaps',
     'django.contrib.staticfiles',
     'mezzanine.conf',
     'mezzanine.core',
     'mezzanine.generic',
     'mezzanine.blog',
     'mezzanine.forms',
     'mezzanine.pages',
     'mezzanine.galleries',
     'mezzanine.twitter',
     'mezzanine.accounts',
     'mezzanine_events',
     'mezzanine_pagedown',
     'gunicorn',
     'storages',
     'debug_toolbar',
     'filebrowser_safe',
     'south',
     'grappelli_safe',
     'django.contrib.admin',
     'django.contrib.comments']
    Installed Middleware:
    ['debug_toolbar.middleware.DebugToolbarMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'mezzanine.core.request.CurrentRequestMiddleware',
     'mezzanine.core.middleware.TemplateForDeviceMiddleware',
     'mezzanine.core.middleware.TemplateForHostMiddleware',
     'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
     'mezzanine.core.middleware.SitePermissionMiddleware',
     'mezzanine.pages.middleware.PageMiddleware']
    
    
    Traceback:
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
      111.                         response = callback(request, *callback_args, **callback_kwargs)
    File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/admin/views/decorators.py" in _checklogin
      16.             return view_func(request, *args, **kwargs)
    File "/app/.heroku/python/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
      89.         response = view_func(request, *args, **kwargs)
    File "/app/.heroku/python/lib/python2.7/site-packages/filebrowser_safe/views.py" in browse
      76.             raise ImproperlyConfigured, _("Error finding Upload-Folder. Maybe it does not exist?")
    
    Exception Type: ImproperlyConfigured at /admin/media-library/browse/
    Exception Value: Error finding Upload-Folder. Maybe it does not exist?
    

    This error seems related to this one in the Mezzanine issue tracker: https://github.com/stephenmcd/mezzanine/issues/530

  4. leonardogentile

    I sometimes happen to have something similar. I open the insert image popup, from there I click on the media library, and without any prediction 1 time over 5 everything get stuck. I mean I can see the media library and the pictures but the mouse selector is stuck in "hand" form and nothing in the page is clickable anymore.
    Sometimes the "select file" image (little arrow pointing down on the left) is not visible. No error at all in the Chrome console or the terminal where python is running.
    Here's my pip freeze -l:

    Django==1.4.3
    Markdown==2.2.1
    Mezzanine==1.3.0
    PIL==1.1.7
    Pygments==1.6
    South==0.7.6
    bleach==1.2
    filebrowser-safe==0.2.14
    grappelli-safe==0.2.11
    html5lib==0.95
    mezzanine-pagedown==0.2
    pytz==2012j
    yolk==0.4.3
    
  5. Eric Boo

    I'm also unable to upload images.

    After selecting an image, nothing seems to happen; the image progress bar doesn't move. This is on localhost.

    If I choose to create a new folder, there's no OK button. Pressing Enter after entering a folder name gives me an entire blank new Content Page.

  6. Ahmad Khayyat repo owner

    Are you guys having upload problems in the main Media library page, or in the Media Library dialog that appears when you click the image button in the pagedown editor?

    Also, given the numerous issues people are having with S3/django-storages and Mezzanine in general, I am only interested in reports using local storage only.

  7. pageworthy

    I had this same issue, or what I thought was the same. I would click on the image box and it would load the media library window correctly. I would then click on upload and it would have the browse button etc. What I didn't realize was that the upload button was not in the pop-up window. Instead it is at the bottom right of the entire browser window! I didn't see it there until I inspected the elements to see what was going on.

    Great work on this btw. I was using mdown and its lack of media browser integration was killing my style.

  8. pageworthy

    I spoke too soon. When I click the upload button it has no effect. I don't see an error it just doesn't do anything. Darn, I thought I had a good thing going there. I can click the clear queue button and it works ok but not the upload.

  9. Ahmad Khayyat repo owner

    Right. Upload does not work in the Media Library dialog. We have two options:

    1. Disable the Upload button in the dialog near the top.
    2. Fix the Upload button at the bottom.

    The Upload button at the bottom calls JavaScript that is in the <head> of the Media Library page, but is not loaded in the dialog.

    I am open for ideas/patches. The easy solution is to hide the buttons in the dialog.

  10. Ahmad Khayyat repo owner

    A little more clarification for everyone to follow along..

    When you click either of the Upload or New Folder buttons in the Media Library dialog that the editor opens, the row of buttons at the very end of the page (outside the dialog) is covered by a new one that finishes the new action (New folder or upload), but the new buttons do not work because they call javaScript that is not available.

    The JavaScript they call is in the <head> of their page. I don't know if there is a way to load that head and the script in it; this is the extent of my JavaScript skills. I can make the new bar of buttons appear inside the dialog instead of covering the original page's bar, but we need to make the buttons work first.

  11. Ahmad Khayyat repo owner

    Hide the buttons and filters from the media library popup

    See issue #3. The buttons require scripts that are not available in the popup. The filters append parameters to the original page's url instead of the url the popup is showing.

    → <<cset 7ff7dda666f9>>

  12. Log in to comment