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

Cannot 'add to garden' control on a guide in some circumstances #809

Closed
CloCkWeRX opened this issue Sep 14, 2016 · 6 comments
Closed

Cannot 'add to garden' control on a guide in some circumstances #809

CloCkWeRX opened this issue Sep 14, 2016 · 6 comments

Comments

@CloCkWeRX
Copy link
Contributor

image

It simply generates a JS error; which may or may not be related

application-422078f….js:15 Uncaught TypeError: Cannot read property 'getBoundingClientRect' of undefined
@simonv3
Copy link
Member

simonv3 commented Sep 14, 2016

Hmm, as I just mentioned on the other issue, users do automatically get a garden added on sign up. (a garden gets added if one doesn't already exist). I wonder if that's related.

@TheChirpyWitch
Copy link
Contributor

This error was not present till some weeks ago. I am working to fix it by trying to find when this functionality was changed.

@simonv3
Copy link
Member

simonv3 commented Sep 14, 2016

I think the "getBoundingClientRect" error is a red herring, for what it's worth.

@TheChirpyWitch
Copy link
Contributor

Yeah, I think so too. I googled the error and it doesn't make much semse. I will try reverting to old code. Let's see what happens.

@CloCkWeRX
Copy link
Contributor Author

getBoundingClientRect

Yeah, it cropped up in another area after I wrote this one up.
I wasn't sure why it occurred and didn't show 'Your First Garden'; similar controls were visible later on - it mislead me into thinking there was no garden at all.

This one might be either a wontfix (as new users have a garden) or might be better to narrow in on just the getBoundingClientRect problem.

@CloCkWeRX CloCkWeRX changed the title Do not show 'add to garden' control on a guide if the user does not have a garden Cannot 'add to garden' control on a guide in some circumstances Sep 15, 2016
@TheChirpyWitch
Copy link
Contributor

This issue is only occurring when we call _add_to_gardens.html from a crop's guide, not when we call it from the crop itself. Meaning that there is some error in the view or functionality for 'add-to-gardens'. So I just commented some HTML as in here:
<div class="add-to-garden center"> <!-- <% if current_user && current_user.confirmed? %> <div add-to-gardens crop-object=guide object-type="'guide'" user=currentUser> </div> <% end %> --> </div>
And voila! It works. Still don't know why this was happening. My best guess is making the first div class 'add-to-garden' was somehow messing things up by rendering our addToGarden functionality.

TheChirpyWitch added a commit to TheChirpyWitch/OpenFarm that referenced this issue Oct 11, 2016
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

3 participants