• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Fixed Draft in a series causing confusion with members

Status
Not open for further replies.

nicodak

Member
AMS Premium
CAS Premium
LD Premium
SC Premium
UBS Premium
Pick'em
Sportsbook
If a draft is assigned to a series, the title of the draft appears as the last article in the series (
if he is) and the click redirects to the classic XF error page. The draft article is also counted in the number of articles in the series.

It is confusing for the user.

You might not assign a draft to a series, but it's still useful for organizing your drafts if you're preparing a lot.
 
If a draft is assigned to a series
Ya, that should not be happening. Articles that are in a non visible state (draft, awaiting, moderated or deleted) are not allowed to be added to a series, so I've added some additional validation checks to the Add Series Part Service as well as some additional checks to all of the permissions checks functions related to adding an Article to a Series, to prevent articles that are not in the state "visible" from being added to a series.

Example of one of the new validation checks added today. If you try to set an article by URL, the validator will now check the state of the article and throw an error that explains to the viewing user that only visible state articles can be added to a series and that the article that they are attempting to add to a series is in a state other than visible (and displays the current state of the article, which the 5 states are "Visible", "Draft", "Awaiting", "Moderated" and "Deleted".

Selection_027.png
 
Last edited:
Along with this, I've created a new Job (XenAddons\AMS\Job:SeriesPart) that when run, will remove any Articles that are not visible that are associated with a Series (using the SeriesPart Deleter Service).

This Job will be triggered as part of the AMS 2.2.20 Upgrade via Post Upgrade processes:
PHP:
        if ($previousVersion && $previousVersion < 2022070)
        {
            $this->app->jobManager()->enqueueUnique(
                'xa_amsUpgradeSeriesPartRebuild',
                'XenAddons\AMS:SeriesPart',
                [],
                false
            );
        }


This Job will also be triggered once every 24 hours by the AMS Daily Clean-up CRON.
PHP:
    public static function runDailyCleanUp()
    {
        $app = \XF::app();

        /** @var \XenAddons\AMS\Repository\Article $artilceRepo */
        $artilceRepo = $app->repository('XenAddons\AMS:Article');
        $artilceRepo->pruneArticleReadLogs();
        $artilceRepo->autoUnfeatureArticles();
       
        $app->jobManager()->enqueueUnique(
            'xa_amsDailyCleanUpSeriesPartRebuild',
            'XenAddons\AMS:SeriesPart',
            [],
            false
        );
    }


This Job can also be processed manually via cache rebuilds >> AMS: Rebuild series parts.

Selection_028.png
 
Status
Not open for further replies.
Back
Top