Package Upgrade bug

Permalink 1 user found helpful
Hi,

I am trying to upgrade a package to 8.3 from 5.6.

I am using this tutorial.
https://documentation.concrete5.org/developers/working-with-blocks/c...

I am getting this error and I don't know why, or how to fix it.
Class does not exist


This is my log file
start install
start addEveryTime
addEveryTime 2
addEveryTime 3
start addBlockType
addBlockType 1
addBlockType 2
addBlockType 3


This is my some bits of my code.

<?php
namespace Concrete\Package\SampleRequest;
defined('C5_EXECUTE') or die(_("Access Denied."));
use Concrete\Core\Package\Package;
use Concrete\Core\Block\BlockController;
use Concrete\Core\Block\BlockType\BlockType;
use Core;
class Controller extends Package {
  public function addEveryTime() {
   $this->logx('start addEveryTime');
//    $this->addSinglePage("/dashboard/sample_request", false);
   $this->logx('addEveryTime 2');
//    $this->addSinglePage("/dashboard/sample_request/download", false);
   $this->logx('addEveryTime 3');
    $this->addBlockType("sample_request");

gwardell
 
A3020 replied on at Permalink Reply
A3020
Why don't you use a tool like xDebug to step through the code?
JohntheFish replied on at Permalink Reply
JohntheFish
If you enable the full debug settings in the dashboard, you will get more detailed info on which class it is that doesn't exist.
gwardell replied on at Permalink Reply
gwardell
Hi,

Thanks. I didn't even know that was there.

I am new to Concreate5.

According to the stack trace it is successfully calling installBlockType, but it doesn't say what the wrong class is. It would appear to be an error in the Concreate5 framework.

So I am still at a loss.
ramonleenders replied on at Permalink Reply
ramonleenders
Probably the wrong namespace for your Block Type (BT)? Where is your controller for the BT located and what is the namespace (and its classname)?
gwardell replied on at Permalink Reply
gwardell
The block is located at:

packages/sample_request/blocks/sample_request

The package name space is:

namespace Concrete\Package\SampleRequest;

The block name space is:

namespace Packages\SampleRequest\Block\SampleRequest;

The package class is:

class Controller extends BlockController

Hmm, should the package name space be?

Concrete\Package\SampleRequest\Block\SampleRequest;

Or what should it be?
ramonleenders replied on at Permalink Best Answer Reply
ramonleenders
If your package's namespace is:

namespace Concrete\Package\SampleRequest;

then your BT's namespace is:

namespace Concrete\Package\SampleRequest\Block\SampleRequest;
gwardell replied on at Permalink Reply
gwardell
Thank you.

That did it.

And thank you for introducing me to the Debug Settings.