XF 2.1 Failure of xf-addon:create. Please help.

Anatoliy

Well-known member
Hi developers,

I'm a noob, just installed a test xenForo, follow xf2-docs/dev/ and when I got to "Create the add-on", I'm stuck. I run '$ php cmd.php xf-addon:create' and getting 'Development output for this add-on ID has been disabled. Cannot continue.'

What could be the reason? Thanks in advance.
 
Just a wild guess here. The error seems to do indicate the _output folder for your add-on is the issue. According to:
View attachment 217486
Hope this was done by you.

Also replace Demo/Portal with your add-on ID

yeah, I did that

Code:
$config['development']['enabled'] = true;
$config['development']['defaultAddOn'] = 'Cmoon/Doit';
$config['cookie']['prefix'] = 'anything_';
$config['enableMail'] = false;
 
I thought that maybe it's a conflict of 2 forums on the same domain, so I installed xenForo on a different domain. Now in ACP I see "The following issues should be resolved. Once they have been resolved, check for upgrades again to confirm. The Board URL option does not match the site URL configured for your license." When I run '$ php cmd.php xf-addon:create' I'm again getting 'Development output for this add-on ID has been disabled. Cannot continue.'
Maybe I need to apply for some registration or approval to use forum software for an add-on development purpose? I remember a year ago I was told that it's ok to use my licensed forum soft to install a second dev copy as long as it's not publicly accessible. Maybe something changed from that time?
 
That message can be ignored for test and development installations.

You just need to ensure they comply with the terms of the license.
You may create additional test installations for the purpose of testing the Software. Any test installation of this kind must be password protected, installed at a URL that makes the testing purpose clear, not used for production purposes and access to it must be limited to You and Your website staff.
 
That message can be ignored for test and development installations.

well I would ignore it, if xf-addon:create would make it's magic. but it didn't. I got the same "Development output for this add-on ID has been disabled "... so I'm deleting the instalation on the other domain, and going back to new orlean that folder 'test' on my main domain...

what that 'Development output for this add-on ID has been disabled' might mean? for what add-on ID? i tried all possible variants. I guess it means 'for any add-on ID has been disabled'.
 
So I'm taking the second attempt to crack this "Building add-ons" thing. And I stuck in the same place.
I created a test replication of my production forum on subdomain test.mydomain.com. Protected the directory with a password. I actually did it for test upgrade to 2.2, and now as it exist I'm trying to use it for add-on development.

I added to /src/config.file:
Code:
$config['development']['enabled'] = true;
$config['development']['defaultAddOn'] = 'AV/Test';

I created a folder AV in /src/addons/ , a folder Test in /src/addons/AV/ , and a folder _output in /src/addons/AV/Test . I gave chmod 777 to /src/addons/AV/Test/_output . In terminal I went to the root directory of my forum ( where cmd.php is located) and run php cmd.php xf-addon:create and I'm getting ' Development output for this add-on ID has been disabled. Cannot continue. '

What am I doing wrong? Please help.
 
Do you get Development output for this add-on ID has been disabled. Cannot continue error right after you run xf-addon:create (which should not throw that error because no Add-on Id is given yet) or after you enter the add-on id?

I did a lot of testing to try to reproduce your error this afternoon and the only way I could reproduce it was to enter xf in the add-on id. It threw this: Development output for this add-on ID has been disabled. Cannot continue, followed by: Note: use of add-on IDs starting with 'xf' is strongly discouraged.

The error above is thrown because of this check: if ($devOutput->isAddOnSkipped($addOnId){...}, do you use 'xf' in your add-on id? As that is the only way I can reproduce it. Note that I did try out creating this manually AV/Test/_output (as per your example) as part of my testing, then ran the create command and it worked as expected.

Note: that you do not need to be in development mode, or set a default add-on id, in the config file to run Cli commands. Also the create function will create all directories, you do not need to, :)
 
Thanks for reply.
Do you get Development output for this add-on ID has been disabled. Cannot continue error right after you run xf-addon:create (which should not throw that error because no Add-on Id is given yet) or after you enter the add-on id?
That's the most confusing part. What "this add-on ID" disabled, if there is no ID yet.
After reading your post I removed folders I created as well as removed from config.php
Code:
$config['development']['enabled'] = true;
$config['development']['defaultAddOn'] = '.../...';

didn't help (

1.webp
 
I don't know anything about it, so my question could be totally silly, but I'll ask anyway.
I enter my CWP, I click Terminal.
It has: user@server_IP. I enter 'cd /path/to/xf/root' and hit enter. I get there, but now string starts from user@serverXX.mydoman.com .
May be I do something wrong here and I enter as a wrong user, and some wrong user permissions or something?
 
I don't really understand why you're not even seeing the "enter an ID for this add-on" prompt, though I wonder if it's on that blank line (text color the same as the background for some reason). That leads me to think that your terminal is being detected as being non-interactive, which means that it won't take input.

I would try connecting through SSH with a dedicated SSH client. (Or sort of better if you're doing development, set up the necessary things locally and use a local terminal/command prompt.)
 
And I'm stuck on the next step. )

1.webp

I follow the tutorial on creating the setup class.

Code:
<?php

namespace AV\Featured;

use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;

use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;

class Setup extends \XF\AddOn\AbstractSetup
{

    public function installStep1()
    {
        $this->schemaManager()->alterTable('xf_forum', function(Alter $table)
        {
            $table->addColumn('av_featured_auto_feature', 'tinyint')->setDefault(0);
        });
    }
    public function installStep2()
{
    $this->schemaManager()->alterTable('xf_thread', function(Alter $table)
    {
        $table->addColumn('av_featured_featured', 'tinyint')->setDefault(0);
    });
}
public function installStep3()
{
    $this->schemaManager()->createTable('xf_av_featured_featured_thread', function(Create $table)
    {
        $table->addColumn('thread_id', 'int');
        $table->addColumn('featured_date', 'int');
        $table->addPrimaryKey('thread_id');
    });
}
}

🤷‍♂️
 
There was an issue in the tutorial example that we've fixed.

The error is complaining about missing methods which are actually provided by the traits you're calling. You just need to include them in your class like so:

PHP:
<?php

namespace AV\Featured;

use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;

use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;

class Setup extends \XF\AddOn\AbstractSetup
{
    use StepRunnerInstallTrait;
    use StepRunnerUpgradeTrait;
    use StepRunnerUninstallTrait;

    public function installStep1()
    {
        $this->schemaManager()->alterTable('xf_forum', function(Alter $table)
        {
            $table->addColumn('av_featured_auto_feature', 'tinyint')->setDefault(0);
        });
    }
    public function installStep2()
    {
        $this->schemaManager()->alterTable('xf_thread', function(Alter $table)
        {
            $table->addColumn('av_featured_featured', 'tinyint')->setDefault(0);
        });
    }
    public function installStep3()
    {
        $this->schemaManager()->createTable('xf_av_featured_featured_thread', function(Create $table)
        {
            $table->addColumn('thread_id', 'int');
            $table->addColumn('featured_date', 'int');
            $table->addPrimaryKey('thread_id');
        });
    }
}
 
Top Bottom