XF 2.0 Forum section titles

oneobgyn

Member
Hello
I have some titles from vBulletin that are too long. It looks like there is a limit to 50 characters in the main category titles. But in member post titles, they are longer.

Is there a setting in the DB or somewhere where I can increase the title length please? Sorry if this has been asked before, but I can't see a solution.
 

oneobgyn

Member
Many thanks ozz747. I did up it to 150 just now (varchar(15) but going back to Admin (refeshed) it still says use a tile less than 50. Is there another table in addition in the DB to change as well?
 

oneobgyn

Member
I can update a title directly in the DB now after the 150 upgrade to that table. But back in XF admin if I~ open up that node title it won't let me edit as says over 50 characters. Is there a cashing issue do you think?
 

Ozzy47

Well-known member
Ok, in XF1
you need to change the datawriter:

library/XenForo/DataWriter/Node.php

Code:
protected function _getFields()
    {
        return array(
            'xf_node' => array(
                'node_id'            => array('type' => self::TYPE_UINT, 'autoIncrement' => true),
                'title'              => array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 50,
                        'requiredError' => 'please_enter_valid_title'
                ),
                'node_name'          => array('type' => self::TYPE_STRING, 'default' => null, 'verification' => array('$this', '_verifyNodeName'), 'maxLength' => 50),
                'description'        => array('type' => self::TYPE_STRING, 'default' => ''),
                'node_type_id'       => array('type' => self::TYPE_BINARY, 'required' => true, 'maxLength' => 25),
                'parent_node_id'     => array('type' => self::TYPE_UINT, 'default' => 0, 'required' => true),
                'display_order'      => array('type' => self::TYPE_UINT, 'default' => 1),
                'lft'                => array('type' => self::TYPE_UINT, 'verification' => array('$this', '_verifyNestedSetInfo')),

I am not sure if the exact location in XF2
 

oneobgyn

Member
I tried that, and changed the value. But it still says in admin no more than 50 characters. I had to use MySQL to edit the titles instead direct in the DB. Weird....
 

ElsmarMarc

Member
I am not sure if the exact location in XF2

XF 2.0.10: /src/XF/Entity/Node.php

Change:

'title' => ['type' => self::STR, 'maxLength' => 50,

to

'title' => ['type' => self::STR, 'maxLength' => 100,

But - Existing titles aren't changed so if you have a lot of imported threads you may as well make the appropriate changes to the database and the Node.php file, and then re-import (assuming you are importing as I have from a vBulletin 3.8.9 instance).

EDIT: minor clarification.
 
Top