stats4sd / Stats4SD-Resources-Site

Reposistory for the Stats4SD Resources Repository
https://resources.stats4sd.org
GNU General Public License v3.0
0 stars 0 forks source link

Editing resource always takes me to the same resource #162

Closed dave-mills closed 6 years ago

dave-mills commented 6 years ago

Possibly related to issue #161...

When I click "edit resource" when looking at a resource, it always takes me to edit the first resource I went to edit this session.

E.g:

Doesn't matter whether I make any edits, save draft or update the live resource or not.

I say this might be related to #161, because of this:

My assumption is that the 'currently editing' resource is set once, then not overridden correctly.

chrismclarke commented 6 years ago

ah, the function to edit a url only gets called on creation of the resource page and strangely seems to be only on first creation (guessing doesn't get properly destroyed when navigating out of resource page mode to other pages). I've simply added the active resource parameter to the function call __getEditResourceLink() -> _getEditResourceLink(resource) which should trigger re-evaluation whenever the resource changes.

chrismclarke commented 6 years ago

actually that makes sense, as page rendering is handled by iron-pages which is just glorified hide/show (once a page has rendered once it never tries to restamp for better efficiency, and hence 'call-once' style functions need to be designed a little more carefully).