Closed (fixed)
Project:
Node.js integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2013 at 21:55 UTC
Updated:
28 Nov 2016 at 02:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedseems like a useful feature to me, patches welcome.
Comment #2
Jorge Navarro commentedIt works, but note that this is my first patch, advises are welcome.
Comment #3
socialnicheguru commentedhow can I check to see if the nodejs is added on an excluded page in order to test?
Comment #4
socialnicheguru commentedI think this works
Comment #5
julien66 commentedEasy testing on this topic could be done with nodejs_checker module !
=> https://drupal.org/project/nodejs_checker
I'm going for some test right now and will report back.
Cheers.
Comment #6
julien66 commentedHey Jorge !
I confirm this patch is working like a charm. Congratulation.
I did some refactoring of your code. It's the same thing, just shorter and hopefully cleaner.
When two functions are looking very similar, it usually worth trying to refactor the code using a variable. You can compare both code to get the idea. Also think about deleting new variables you set by using variable_del() into hook_uninstall.
=> @Beejebus, I set this issue as reviewed & tested. Please set the authorship to Jorge for his first patch !
Cheers.
++
Comment #7
Anonymous (not verified) commentedthis looks good. a couple of things i'd like to see changed:
- please take the $disabled out of the function signature, and check that inside the inside the body of nodejs_add_js_to_page_check()
- i wonder if we should update the form to look more like block visibility, see image below
Comment #8
Anonymous (not verified) commentedComment #9
julien66 commentedHi Beejeebus.
Here's a new patch that does what's requested at #7.
Cheers !
Comment #10
Anonymous (not verified) commentedthanks! getting closer :-)
this doesn't look quite right. as i read it, i think that will reverse the current default behaviour. i think we need something like this:
does that make sense? explicitly name the type of list we are using, and only run the regex if we need to. sorry for being so picky.
Comment #11
julien66 commentedHi Beejeebus,
Thanks for your fast reply and for your eyes.
I had the same doubt than yours writing this line, I wrote almost the same code as you did before I realised it wasn't necessary at all.
The actual behavior of patch #9 is already correct from my point of view. Here's how I see it :
By now, default behavior is to set Nodejs active into => all page except thoses listed, with a blank list '' as variable.
It's the opposite than before where Nodejs was active in => only the listed page, with a wildcard ('*') as variable.
This switch is a consequence of having the same behavior than for block visibility pages.
Now for...
By default then, $valid_page is always FALSE, because '' matches nothing at all. This is great because the default behavior assume that we'll refuse the acces to the listed pages in case of $valid_page returning TRUE.
I tested this in all possible options. Worked fine.
=> Please have another look at it and tell me !
Comment #12
Anonymous (not verified) commentedi'd really like to see us use 'whitelist' and 'blacklist' here.
it's too easy to read that code wrong otherwise.
Comment #13
socialnicheguru commentedThis patch works for me
Comment #14
socialnicheguru commentedComment #15
socialnicheguru commentedThis needs to be rerolled
Comment #17
glekli commentedWonderful, thank you. This has been committed.
I made the following tweaks to the patch:
- The fieldset element does not need a default value
- Renamed variable for clarity
- The default should remain the same as before, and the new option should default to 'only the listed' pages, so that the behavior does not change when people update the module=