• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

JavaScript console

Lu Jia

Active member
#1
Code:
The server responded with an error. The error message is in the JavaScript console.
Where can I found it?
 

SchmitzIT

Well-known member
#4
So I see this error when I try out some new functionality. When I check the JS error console, no errors - only warnings.

Any ideas or thoughts on how I can figure out what is going wrong? I'm currently trying to save a new record.

Here's the template:

<xen:title>{xen:if '{$category.category_id}', '{xen:phrase si_links_edit_category}: {$category.category_title}', '{xen:phrase si_links_create_new_category}'}</xen:title>

<xen:form class="AutoValidator"
action="{xen:adminlink 'si_links_category/save', $category}"
data-formValidatorUrl="{xen:adminlink 'si_links_category/save.json', $category}"
data-fieldValidatorUrl="{xen:adminlink 'si_links_category/validate-field.json', $category}"
data-redirect="on">

<xen:textboxunit label="{xen:phrase title}:" name="category_title" value="{$category.category_title}" data-liveTitleTemplate="{xen:if {$category.category_id},
'{xen:phrase si_links_edit_category}: <em>%s</em>',
'{xen:phrase si_links_create_new_category}: <em>%s</em>'}" />
<xen:textboxunit label="{xen:phrase si_links_description}:" name="category_description" value="{$category.category_description}" />
<xen:textboxunit label="{xen:phrase si_links_sort_order}:" name="category_sort_order" value="{$category.category_sort_order}" />

<xen:submitunit save="{xen:phrase si_links_save_category}">
<xen:if is="{$category.category_id}"><a href="{xen:adminlink 'si_links_category/delete', $category}" class="button OverlayTrigger">{xen:phrase si_links_delete_category}</a></xen:if>
</xen:submitunit>
</xen:form>
The action /save goes to the PrefixAdmin class, which in turn bumps it on onto the ControllerAdmi. ActionSave there is defined like so:

Code:
    public function actionSave()
    {
        $this->_assertPostOnly();

        $categoryId = $this->_input->filterSingle('category_id', XenForo_Input::UINT);
        $dwInput = $this->_input->filter(array(
            'category_title' => XenForo_Input::STRING,
            'category_description' => XenForo_Input::STRING,
            'category_sort_order' => XenForo_Input::UINT,
        ));

        $dw = XenForo_DataWriter::create('SchmitzIT_Links_DataWriter_Category');
        if ($categoryId)
        {
            $dw->setExistingData($categoryId);
        }
        $dw->bulkSet($dwInput);
        $dw->save();

        return $this->responseRedirect(
            XenForo_ControllerResponse_Redirect::SUCCESS,
            XenForo_Link::buildAdminLink('si_category')
        );
    }
This has been driving me nuts. Any help would be appreciated :)

Thanks.
 

SchmitzIT

Well-known member
#5
I found the cause of the issue for my error. I had been renaming a few objects in my code, and the Controller_Response thus ended up pointing to an admin-link that no longer existed.