Incorrect status options on subscription details page
-
Hi,
Class MS_Model_Member defines the subscriptions as protected.
Class MS_Model_Relationship defines the __get magic function, but not __isset.
The problem then occurs when MS_View_Member_Editor builds the list of fields in prepare_fields_edit(), where this code ALWAYS comes up true for empty(subscription->expire_date) and so the block never triggers.// Expire date already reached:
elseif ( ! empty( $subscription->expire_date ) && strtotime( $subscription->expire_date ) < strtotime( MS_Helper_Period::current_date() ) ) {See the notes on the php.net page for the empty() function. If you define __get when the members aren’t public then you also have to define __isset.
It’s easy to reproduce the problem. Just look at the subscription details page for a member whose subscription has expired. The status choices are not correct.
This may come up elsewhere too whereever empty() is used in a similar manner.
- The topic ‘Incorrect status options on subscription details page’ is closed to new replies.