Skip to Content Skip to Menu

[#5334] Mass Expiry not working for 2 of our Plans

  • petekuhn
  • petekuhn
  • OFFLINE
  • Posts: 239
  • Thanks: 34
  • Karma: 0
9 years 4 months ago - 9 years 4 months ago #265685 by petekuhn
Running CB 2.0.9, PHP 5.5.21. CBSubs GPL 4.0.0-rc.2. I had seen this on CB 1.9.1 and written it off to a database corruption problem ( www.joomlapolis.com/forum/153-professional-member-support/226779-solved-subscriptions-for-two-plans-not-expiring ).

I have been testing CB 2, and I'm seeing the same problem. I think I understand at least the proximate cause. All of the subscriptions that are expiring have plans that are viewable public and can be seen in the front end. The two plans that are not expiring have plans that are only viewable at higher access levels and cannot be seen in the front end.

I modified cbpaidPlandMgr.php to comment out line 133:

$where[] = "a.viewaccesslevel IN " . $this->_db->safeArrayOfIntegers( Application::MyUser()->getAuthorisedViewLevels() );

The subscriptions then expire as they should. I'm no expert in your code, obviously, so I can't go any farther. But I hope this will point you to the problem. From the function you're using here, I'm reasonably certain that it's the access level of the plan and not whether it's viewable in the front-end.
Last edit: 9 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 4 months ago #265710 by krileon
Replied by krileon on topic Mass Expiry not working for 2 of our Plans
CBSubs 4.0.0 Stable has released. Please update to latest CB nightly below and install CBSubs 4.0.0 Stable and see if your issue persists.

www.joomlapolis.com/downloads/doc_details/640-community-builder-nightly-build
www.joomlapolis.com/downloads/doc_details/766-cbsubs-gpl-40-stable-package


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • petekuhn
  • petekuhn
  • OFFLINE
  • Posts: 239
  • Thanks: 34
  • Karma: 0
9 years 4 months ago #265738 by petekuhn
Replied by petekuhn on topic Mass Expiry not working for 2 of our Plans
Still fails for the plans with higher access than public. And the code in cbpaidPlandMgr.php hasn't changed in the area where I pointed out the problem.

It still seems that the mass expiry only happens for plans that are viewable public.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 4 months ago - 9 years 4 months ago #265759 by krileon
Replied by krileon on topic Mass Expiry not working for 2 of our Plans
It's supposed to load all plans if no user object is supplied. Please make the below change and see if your issue persists. Do not just remove that line of code though as you're breaking view access level checks for plans.

IN: components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/libraries/cbpaidPlansMgr.php
ON: Line 129 - 134
FROM:
Code:
if ( $user ) { // Old groups-based access: $where[] = "a.access IN (" . implode( ',', $_CB_framework->acl->get_groups_below_me( $user->id, true ) ) . ")"; } // New view access levels: $where[] = "a.viewaccesslevel IN " . $this->_db->safeArrayOfIntegers( Application::MyUser()->getAuthorisedViewLevels() );
TO:
Code:
if ( $user ) { // Old groups-based access: $where[] = "a.access IN (" . implode( ',', $_CB_framework->acl->get_groups_below_me( $user->id, true ) ) . ")"; // New view access levels: $where[] = "a.viewaccesslevel IN " . $this->_db->safeArrayOfIntegers( Application::User( $user->id )->getAuthorisedViewLevels() ); }

#5334


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 9 years 4 months ago by krileon.
The following user(s) said Thank You: beat, nant

Please Log in or Create an account to join the conversation.

  • petekuhn
  • petekuhn
  • OFFLINE
  • Posts: 239
  • Thanks: 34
  • Karma: 0
9 years 4 months ago #265766 by petekuhn
Replied by petekuhn on topic Mass Expiry not working for 2 of our Plans
That worked. Thanks.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
9 years 4 months ago #265786 by beat
Fixed as proposed in next nightly CBSubs build that will be available tomorrow.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum