-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid display of "Back to subscriptions" button when no subscription available to the user. #229
Comments
I was able to replicate this error after subscribing without commenting on a post as a non logged-in user. Also, after creating my subscription, I encountered that error again when I clicked on Back to My Subscriptions. If a confirmation from the subscriber needs to be made before one can view their subscriptions, shouldn't there be a note to say that instead of the error message? Tested with Comment Mail Lite and Pro Version 160211-RC on a clean install |
@raamdev @Reedyseth @kristineds Working fine on my end.
I did however experience this before in an older version of Comment-Mail, #134 (comment) The issue disappeared after disabling all plugins except Comment-Mail Pro. When I re-enabled all plugins again, everything was still working fine. |
@renzms writes...
Are you logged in? That screenshot looks like you might be logged in, or you might already have a bunch of subscription associated with the I believe @kristineds and @Reedyseth are referring specifically to non-logged-in users, as Kristine mentioned in her last comment. I was able to confirm the behavior that Israel and Kristine have observed: Scenario 1 (not logged in)
Scenario 2 (logged in, no subscriptions)
In all cases, that link leads to a page with an error: This error makes sense, because there are no subscriptions to list for this user because they are not yet known to Comment Mail (i.e., they don't have a Subscription Key yet). Once they confirm their first subscription, a Subscription Key is created for them and whenever they visit those pages after confirming their subscription, the presence of the key (for non-logged-in users) makes all of the pages work (for logged-in users, they just need to have a confirmed subscription; the key does not need to be present in the URL). How this needs to be fixedSo, what we need to do is detect various scenarios where those links would lead to that error page and hide them so that users cannot easily reach that error page and get confused. From what I've tested, these are the two common scenarios where those links should be hidden:
|
Yes, I tried it without being logged in and now I see the error now too.
Agree, I tried both scenarios also to duplicate and used a 3rd scenario.
|
@renzms writes...
Can you provide screenshots please? I'm not following... |
@raamdev I can work on this issue if it is ok with you ? |
@Reedyseth Sure. :-) |
@Reedyseth Here are some lines that should help you out. $current_email = $this->plugin->utils_sub->currentEmail();
$has_subscriptions = $current_email ? (bool)$this->plugin->utils_sub->queryTotal(null, ['sub_email' => $current_email, 'status' => 'subscribed', 'sub_email_or_user_ids' => true]) : false; So a conditional might then look something like this... if ($is_edit || ($current_email && $has_subscriptions)) {
// Display the link.
} See also: https://github.com/websharks/comment-mail-pro/blob/000000-dev/src/includes/classes/UtilsSub.php#L566 |
Punting this to the Future Release milestone. |
@raamdev Thanks for the help ! |
@raamdev I tried changing this line of code to this: $sub_summary_return_url = $has_subscriptions && $plugin->utils_url->subManageSummaryUrl($sub_key, null, true); But I'm getting this error message (found here):
Any idea how to fix it? :) cc @jaswsinc |
@kristineds It's not clear to me which line you're trying to change. The link you provided doesn't lead to a specific line, but rather to the entire diff, so I have no idea which specific line you're referring to. :-) |
@raamdev Sorry about that. 😞 I'm trying to change this line: https://github.com/websharks/comment-mail-pro/blob/000000-dev/src/includes/templates/type-s/site/footer-tag.php#L34 Or should I be looking at another file to fix this issue? |
This line doesn't look right to me because it's basically giving $sub_summary_return_url = $has_subscriptions && $plugin->utils_url->subManageSummaryUrl($sub_key, null, true); Can you explain to me what you're trying to do on that line? |
Comment moved inside PR issue.
|
Have you confirmed there's even an issue there? :-) |
Next Release Changelog:
|
- **Bug Fix**: Fixed a bug where the "My Comment Subscriptions" link would appear on the Add New Subscription page (when Subscribing without Commenting) and would lead to a page that displayed an error message stating that there were no subscriptions to list. That link is now hidden when there are no subscriptions to list. Props @Reedyseth @kristineds. See [Issue #229](#229). - **Bug Fix** (Pro): Removed an erroneous anchor tag in the Advanced Template for Comment Notification Message Body. Props @kristineds. See [Issue #287](#287). - **UI Enhancement:** Improved the nav bar at the top of the options pages to reduce unnecessary whitespace. Also moved the Restore button to the nav bar so that it's not so prominent. Props @renzms. See [Issue #284](#284). - **UI Enhancement:** Added links to the Comment Mail [Twitter](http://twitter.com/CommentMail) and [Facebook](https://www.facebook.com/Comment-Mail-565683256946855/) pages to the nav bar on the options page. Props @renzms. See [Issue #286](#286). - **UX Enhancement:** Removed IP address information from email notification templates to better comply with data protection laws in certain countries. Props @kristineds. See [Issue #288](#288). - **SEO Improvement:** Added `rel="nofollow"` to the "Subscribe without Commenting" link and "Manage Subscriptions" link on the comment subscription form to avoid indexing or transferring PageRank. Props @IvanRF. See [Issue #80](wpsharks/comment-mail-pro#80). - Removed several development-only files from the distributable that were inadvertently included during the build process. See [Issue #285](#285). - Added Renz Sevilla (`renzms`) to the contributors list.
Comment Mail v160818 has been released and includes changes from this GitHub Issue. See the v160818 announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#229). |
I noticed that on the
Add Subscription
page there is a button to return to my subscriptions, so I clicked on it an got an error retrieving my subscription. An enhacement could be to not display that button if there are not subscriptions associatedThis is display when I click on the button
The text was updated successfully, but these errors were encountered: