Groups - Version 2.0.3

Version Description

  • Fixed a "Fatal error: Call to a member function get_role_caps() on a non-object" which could occur in circumstances with invalid user IDs.
Download this release

Release Info

Developer itthinx
Plugin Icon 128x128 Groups
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

Files changed (4) hide show
  1. changelog.txt +5 -1
  2. groups.php +2 -2
  3. lib/core/class-groups-user.php +3 -0
  4. readme.txt +9 -4
changelog.txt CHANGED
@@ -1,4 +1,8 @@
1
- == Groups changelog.txt ==
 
 
 
 
2
 
3
  = 2.0.2 =
4
  * Added the option to dismiss the Welcome screen.
1
+ == Groups by itthinx - changelog.txt ==
2
+
3
+ = 2.0.3 =
4
+ * Fixed a "Fatal error: Call to a member function get_role_caps() on a non-object" which
5
+ could occur in circumstances with invalid user IDs.
6
 
7
  = 2.0.2 =
8
  * Added the option to dismiss the Welcome screen.
groups.php CHANGED
@@ -21,7 +21,7 @@
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
- * Version: 2.0.2
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
@@ -32,7 +32,7 @@
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
- define( 'GROUPS_CORE_VERSION', '2.0.2' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 2.0.3
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
32
  if ( !defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
+ define( 'GROUPS_CORE_VERSION', '2.0.3' );
36
  define( 'GROUPS_FILE', __FILE__ );
37
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
38
  define( 'GROUPS_CORE_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
lib/core/class-groups-user.php CHANGED
@@ -108,6 +108,9 @@ class Groups_User implements I_Capable {
108
  public function __construct( $user_id ) {
109
  if ( Groups_Utility::id( $user_id ) ) {
110
  $this->user = get_user_by( 'id', $user_id );
 
 
 
111
  } else {
112
  $this->user = new WP_User( 0 );
113
  }
108
  public function __construct( $user_id ) {
109
  if ( Groups_Utility::id( $user_id ) ) {
110
  $this->user = get_user_by( 'id', $user_id );
111
+ if ( !$this->user ) {
112
+ $this->user = new WP_User( 0 );
113
+ }
114
  } else {
115
  $this->user = new WP_User( 0 );
116
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: itthinx, proaktion
3
  Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, memberships, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
  Requires at least: 4.0
6
- Tested up to: 4.7.2
7
- Stable tag: 2.0.2
8
  License: GPLv3
9
 
10
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
@@ -190,6 +190,10 @@ See also the [Groups Documentation](http://docs.itthinx.com/document/groups/) pa
190
 
191
  == Changelog ==
192
 
 
 
 
 
193
  = 2.0.2 =
194
  * Added the option to dismiss the Welcome screen.
195
  * Updated German and Spanish translations.
@@ -214,5 +218,6 @@ See also the [Groups Documentation](http://docs.itthinx.com/document/groups/) pa
214
 
215
  == Upgrade Notice ==
216
 
217
- = 2.0.2 =
218
- Groups 2.0.2 simplifies the way access restrictions are handled.
 
3
  Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, memberships, paypal, permission, permissions, subscription, subscriptions, woocommerce
5
  Requires at least: 4.0
6
+ Tested up to: 4.7.3
7
+ Stable tag: 2.0.3
8
  License: GPLv3
9
 
10
  Groups is an efficient and powerful solution, providing group-based user membership management, group-based capabilities and content access control.
190
 
191
  == Changelog ==
192
 
193
+ = 2.0.3 =
194
+ * Fixed a "Fatal error: Call to a member function get_role_caps() on a non-object" which
195
+ could occur in circumstances with invalid user IDs.
196
+
197
  = 2.0.2 =
198
  * Added the option to dismiss the Welcome screen.
199
  * Updated German and Spanish translations.
218
 
219
  == Upgrade Notice ==
220
 
221
+ = 2.0.3 =
222
+ Groups 2.x simplifies the way access restrictions are handled.
223
+ This release fixes an issue which could bring up an error with invalid user IDs.