django-photologue icon indicating copy to clipboard operation
django-photologue copied to clipboard

Only one photo is kept in gallery after toggling "Is public" off and back on.

Open maheshkronecker opened this issue 9 years ago • 20 comments

Hello. I have a Photologue gallery with 6 photos, initially correctly displayed. In the admin page "Change gallery", if I toggle "Is public" off, save the settings, and later toggle "Is public" back on, only one of the 6 photos is ticked in the Photos section. If I try to manually re-select the other 5 photos and save, it will have no effect, only one photo will be displayed in the gallery. Is this a bug? Can someone reproduce it? Thanks.

maheshkronecker avatar Jan 07 '16 04:01 maheshkronecker

Hi, I can't seem to reproduce this bug. Could you provide more details please: Django version, Photologue version, Python version, ...

richardbarran avatar Jan 07 '16 20:01 richardbarran

Hi. Sorry, should have done that first:

Working in a Vagrant VM and a virtualenv local environment. Server is Apache 2.4.

python —version

Python 3.4.3

pip show django

Metadata-Version: 2.0 Name: Django Version: 1.8.7

pip show django-cms

Metadata-Version: 2.0 Name: django-cms [Note: does not yet support django 2.9] Version: 3.2.0

pip show django-photologue

Metadata-Version: 2.0 Name: django-photologue Version: 3.4.1

sudo pip3 show virtualenv

Name: virtualenv Version: 13.1.2

lsb_release -a

Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty

On Jan 8, 2016, at 4:54 AM, Richard Barran [email protected] wrote:

Hi, I can't seem to reproduce this bug. Could you provide more details please: Django version, Photologue version, Python version, ...

— Reply to this email directly or view it on GitHub https://github.com/jdriscoll/django-photologue/issues/150#issuecomment-169802181.

maheshkronecker avatar Jan 08 '16 01:01 maheshkronecker

Hi, Thanks for the extra information; even armed with that, I still cannot reproduce this bug. There must be something specific to your environment that is causing the issue. If it's a problem with Photologue, then presumably someone else will encounter this bug; so I will leave this ticket open for a while, to see if more information becomes available.

richardbarran avatar Jan 09 '16 17:01 richardbarran

Understood and thank you for looking into this. I will investigate further at my end to see whether I can find out which peculiarity in my own settings may be causing the problem, which I can still easily reproduce for the moment. I will let you know if I find out.

On Jan 10, 2016, at 1:19 AM, Richard Barran <[email protected] mailto:[email protected]> wrote:

Hi, Thanks for the extra information; even armed with that, I still cannot reproduce this bug. There must be something specific to your environment that is causing the issue. If it's a problem with Photologue, then presumably someone else will encounter this bug; so I will leave this ticket open for a while, to see if more information becomes available.

— Reply to this email directly or view it on GitHub https://github.com/jdriscoll/django-photologue/issues/150#issuecomment-170261049.

maheshkronecker avatar Jan 11 '16 00:01 maheshkronecker

I have the same issue. If I select multiple images from gallery and view my site only one image is shown. when I go back to gallery only one image is shown as selected. I am using django 1.10 and apache.

heicci avatar Aug 14 '16 12:08 heicci

Im having the same issue where if I select multiple photos to add to my gallery and hit save only the first selected photo gets added to that gallery. At first when I was setting up photologue I was following the steps in the documentation. I created my own folder called "photoGallery" and inside there it had a models.py file which looked like this https://pastebin.com/AZ2ibQwP and it also had an admin.py file which looked like this. https://pastebin.com/uzQHrBPc

In the end I wasnt able to figure out how to view the gallery on the front end of my website so I just ended up using all the default files from the photologue folder instead of the custom folder that I made. On my site i can view any galleries I make but each gallery only saves one picture. Here is a link to my websites gallery page http://www.vacationcondos.vegas/photologue/gallery/ python --version 2.7.6

pip show django name: django version: 1.11.3

pip show django-photologue name: django-photologue Version: 3.7

lsb_release -a Distributor ID: Ubuntu Description Ubuntu 14.04.4 LTS Release 14.04 Codename trusty

Tedgar20 avatar Jul 24 '17 20:07 Tedgar20

Hi @Tedgar20 apologies for the slow response. What version of django-sortedm2m is installed on your system?

richardbarran avatar Aug 25 '17 15:08 richardbarran

@richardbarran thanks for responding back. How would I go about checking that?

Tedgar20 avatar Aug 25 '17 16:08 Tedgar20

@Tedgar20 the command pip freeze will list all 3rd party packages installed - there will be a line with django-sortedm2m and its version number.

richardbarran avatar Aug 25 '17 16:08 richardbarran

@richardbarran django-sortedm2m==1.4.0

Tedgar20 avatar Aug 25 '17 16:08 Tedgar20

Hi again - I thought that maybe the issue was caused by an old version of django-sortedm2m - but 1.4.0 is a recent release. So that's not the issue. So I'm still confused by this issue, as I cannot reproduce it. From your description, I'm wondering if the Javascript in the admin page is broken, and that when you select multiple photos and hit 'save', only the first photo's information is sent back to the server. But this is just speculation by me.

richardbarran avatar Aug 25 '17 16:08 richardbarran

Yeah maybe thats it. Thanks anyway for responding though I really appreciate it.

Tedgar20 avatar Aug 25 '17 16:08 Tedgar20

I had the same problem but managed to sort it out.

Make sure you run the following command after installing the library:

python manage.py collectstatic

grouser avatar Jan 17 '18 11:01 grouser

I've been having the same problem. Everything works locally, but I can only select one photo per gallery when in production.

python manage.py collectstatic doesn't seem to solve it.

nihal111 avatar Jan 30 '18 14:01 nihal111

I figured out what was causing the problem. The static js and css files belonging to sortedm2m were getting a 404 on the production website. To identify if this is the issue with you, check the Networks tab of the developer console in your browser to see if all files are loading with code 200.

When I checked on the localhost website, I found all those files being fetched normally (200 OK). image

To solve this I copied the js and css files belonging to sortedm2m into project_root_directory/static/sortedm2m/

Running a python manage.py collectstatic after this solved my problem. @richardbarran I think the sortedm2m static files should be added inside this directory- https://github.com/jdriscoll/django-photologue/tree/master/example_project/example_project/static Not sure if it's the right practice.

If anyone faces the same issue, please try the above steps and confirm if the solution works for you.

nihal111 avatar Feb 07 '18 20:02 nihal111

I can confirm @nihal111 solution.

cubells avatar Apr 28 '18 11:04 cubells

I'm glad that @nihal111 has found a workaround, and that @cubells has confirmed that it works. I'm uneasy with the suggestion to copy sortedm2m static files into Photologue - I think that the issue is with sortedm2m, and needs sorting there. I have a question for @nihal111 and for @cubells - can you confirm that sortedm2m is in the INSTALLED_APPS setting?

richardbarran avatar Apr 29 '18 19:04 richardbarran

@richardbarran Confirming that sortedm2m was in fact inside INSTALLED_APPS in my settings.py file.

nihal111 avatar Apr 29 '18 19:04 nihal111

Yes, I can confirm @richardbarran

cubells avatar Apr 30 '18 14:04 cubells

Thanks both for the input. If anyone has this issue again - could you please paste a screenshot of the Networks tab of the developer console in your browser. I'd be very interested in seeing which files are not being loaded.

richardbarran avatar May 02 '18 19:05 richardbarran