Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maheshkronecker opened this issue Jan 7, 2016 · 20 comments

Comments

@maheshkronecker
Copy link

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.

@richardbarran
Copy link
Owner

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

@maheshkronecker
Copy link
Author

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 #150 (comment).

@richardbarran
Copy link
Owner

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.

@maheshkronecker
Copy link
Author

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 #150 (comment).

@heicci
Copy link

heicci commented Aug 14, 2016

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.

@Tedgar20
Copy link

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

@richardbarran
Copy link
Owner

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

@Tedgar20
Copy link

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

@richardbarran
Copy link
Owner

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

@Tedgar20
Copy link

@richardbarran django-sortedm2m==1.4.0

@richardbarran
Copy link
Owner

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.

@Tedgar20
Copy link

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

@grouser
Copy link

grouser commented Jan 17, 2018

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

@nihal111
Copy link

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
Copy link

nihal111 commented Feb 7, 2018

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.

@cubells
Copy link

cubells commented Apr 28, 2018

I can confirm @nihal111 solution.

@richardbarran
Copy link
Owner

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?

@nihal111
Copy link

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

@cubells
Copy link

cubells commented Apr 30, 2018

Yes, I can confirm @richardbarran

@richardbarran
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants