What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

  • This area is dedicated to the support of our xF1 add-ons. For xF2, please use the dedicated area: HERE.
  • We are aware that a no permission error was shown when you tried to purchase in the last 2 days, this is now fixed.

Bug Fixed Attachment Browser Server Error

Freelancer

Member
As soon as I want to visit the Attachment browser in Admin ACP (admin.php?attachments/), I receive the following Server Error (directly shown on the attachment page and in the Error Listings...)

Code:
Error Info
Invalid model 'XFA_DocMngr_Model_Category' specified - library/XenForo/Model.php:192

Stack Trace
#0 /var/www/clients/client180/web812/web/library/XFA/ExtendedCover/AttachmentHandler/ShowcaseCatCover.php(55): XenForo_Model::create('XFA_DocMngr_Mod...')
#1 /var/www/clients/client180/web812/web/library/XFA/ExtendedCover/AttachmentHandler/ShowcaseCatCover.php(42): XFA_ExtendedCover_AttachmentHandler_ShowcaseCatCover->_getCategoryModel()
#2 /var/www/clients/client180/web812/web/library/XFA/ExtendedCover/AttachmentHandler/ShowcaseCatCover.php(49): XFA_ExtendedCover_AttachmentHandler_ShowcaseCatCover->getContentDataFromContentId(67)
#3 /var/www/clients/client180/web812/web/library/XenForo/Model/Attachment.php(473): XFA_ExtendedCover_AttachmentHandler_ShowcaseCatCover->getContentLink(Array, Array, false)
#4 /var/www/clients/client180/web812/web/library/XenForo/Model/Attachment.php(434): XenForo_Model_Attachment->getContentLink(Array)
#5 /var/www/clients/client180/web812/web/library/XenForo/Model/Attachment.php(454): XenForo_Model_Attachment->prepareAttachment(Array, true)
#6 /var/www/clients/client180/web812/web/library/XenForo/ControllerAdmin/Attachment.php(91): XenForo_Model_Attachment->prepareAttachments(Array, true)
#7 /var/www/clients/client180/web812/web/library/SV/AttachmentImprovements/XenForo/ControllerAdmin/Attachment.php(13): XenForo_ControllerAdmin_Attachment->actionIndex()
#8 /var/www/clients/client180/web812/web/library/XenGallery/ControllerAdmin/Attachment.php(7): SV_AttachmentImprovements_XenForo_ControllerAdmin_Attachment->actionIndex()
#9 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(351): XenGallery_ControllerAdmin_Attachment->actionIndex()
#10 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#11 /var/www/clients/client180/web812/web/admin.php(13): XenForo_FrontController->run()
#12 {main}

Request State
Array
(
    [url] => https://www.mywebsite.com/admin.php?attachments/
    [_GET] => Array
        (
            [attachments/] =>
        )

    [_POST] => Array
        (
        )

)
 

Fred

Administrator
Staff member
In library\XFA\ExtendedCover\AttachmentHandler\ShowcaseCatCover.php

Replace content of class by

PHP:
class XFA_ExtendedCover_AttachmentHandler_ShowcaseCatCover extends XenForo_AttachmentHandler_Abstract
{
    protected $_contentIdKey            = 'category_id';

    protected $_contentTypePhraseKey    = 'xfaEcShowcaseCat';

    protected $_contentRoute            = 'category';

    protected function _canUploadAndManageAttachments(array $contentData, array $viewingUser)
    {
        return true;
    }

    protected function _canViewAttachment(array $attachment, array $viewingUser)
    {
        return true;
    }

    public function attachmentPostDelete(array $attachment, Zend_Db_Adapter_Abstract $db)
    {

    }

    public function getAttachmentConstraints()
    {
        return $this->_getExtendedCoverModelShowcaseCategory()->getCoverAttachmentConstraints();
    }


    public function getContentDataFromContentId($contentId)
    {
        $categoryCover = $this->_getCategoryModel()->getCategoryById($contentId);
        return ($categoryCover ? $categoryCover : parent::getContentDataFromContentId($contentId));
    }


    public function getContentLink(array $attachment, array $extraParams = array(), $skipPrepend = false)
    {
        $entry = $this->getContentDataFromContentId($attachment['content_id']);
        return XenForo_Link::buildPublicLink($this->_contentRoute, $entry, $extraParams, $skipPrepend);
    }

    protected function _getCategoryModel()
    {
        return XenForo_Model::create('NFLJ_Showcase_Model_Category');
    }

    /**
     * @return XFA_ExtendedCover_Model_ShowcaseCategory
     * @throws XenForo_Exception
     */
    protected function _getExtendedCoverModelShowcaseCategory()
    {
        return XenForo_Model::create('XFA_ExtendedCover_Model_ShowcaseCategory');
    }
}

It's should fix your problem
 

Freelancer

Member
Thank you... interestingly, the error vanished from alone... I dont know why... but maybe another update from another add-on fixed the problem... I will observe if this happens again...
 
Top