apeisa / UserGroups

Adds users groups and page based permission to ProcessWire
GNU General Public License v2.0
11 stars 4 forks source link

PW3 compatibility with new PagesType constructor #45

Open BitPoet opened 8 years ago

BitPoet commented 8 years ago

The constructor for PagesType takes the current ProcessWire instance as additional first argument in PW3. Thus, the init method of UserGroupsHooks needs to be changed to $groups = new PagesType($this->wire, $template, $parent->id);

teppokoivula commented 8 years ago

Just a quick note: this will fail in earlier versions, so we'll have to add a version check here or create a new 3.x branch for the module. At the moment a version check seems like the lesser of two evils :)

teppokoivula commented 8 years ago

Another note: I'm wondering why PagesType expects an instance of ProcessWire as it's first argument? Seems to me that making it the last argument would've made it possible to avoid breaking backwards compatibility without any obvious drawbacks.

If @ryancramerdesign is around, I'd appreciate a comment on this one :)