K
K
Konstantin2021-08-10 15:58:11
Yii
Konstantin, 2021-08-10 15:58:11

The admin panel of the Yii site does not work after the transfer, where to dig?

Good afternoon everyone.
When trying to transfer a site written under Yii 1.1.13 to VPS, a number of problems arose. one part was solved by launching the site under PHP 5.0, and the other turned out to be more difficult: there was a problem with the site's admin panel not opening, an error occurs:
Fatal error: Class 'TbBaseMenu' not found in /home/safaridi/domains/ukrsafaritur.com/protected/extensions/bootstrap /widgets/TbMenu.php on line 16

while the mentioned 16th line looks like this:
class TbMenu extends TbBaseMenu

here is the whole TbMenu.php for clarity

spoiler
<?php
/**
 * TbMenu class file.
 * @author Christoffer Niska <ChristofferNiska@gmail.com>
 * @copyright Copyright &copy; Christoffer Niska 2012-
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @package bootstrap.widgets
 */

Yii::import('bootstrap.widgets.TbBaseMenu');

/**
 * Bootstrap menu.
 * @see http://twitter.github.com/bootstrap/components.html#navs
 */
class TbMenu extends TbBaseMenu
{
  // Menu types.
  const TYPE_TABS = 'tabs';
  const TYPE_PILLS = 'pills';
  const TYPE_LIST = 'list';

  /**
   * @var string the menu type.
   * Valid values are 'tabs' and 'pills'.
   */
  public $type;
  /**
   * @var string|array the scrollspy target or configuration.
   */
  public $scrollspy;
  /**
  * @var boolean indicates whether the menu should appear vertically stacked.
  */
  public $stacked = false;
  /**
   * @var boolean indicates whether dropdowns should be dropups instead.
   */
  public $dropup = false;

  /**
   * Initializes the widget.
   */
  public function init()
  {
    parent::init();

    $classes = array('nav');

    $validTypes = array(self::TYPE_TABS, self::TYPE_PILLS, self::TYPE_LIST);

    if (isset($this->type) && in_array($this->type, $validTypes))
      $classes[] = 'nav-'.$this->type;

    if ($this->stacked && $this->type !== self::TYPE_LIST)
      $classes[] = 'nav-stacked';

    if ($this->dropup === true)
      $classes[] = 'dropup';

    if (isset($this->scrollspy))
    {
      $scrollspy = is_string($this->scrollspy) ? array('target'=>$this->scrollspy) : $this->scrollspy;
      $this->widget('bootstrap.widgets.TbScrollSpy', $scrollspy);
    }

    if (!empty($classes))
    {
      $classes = implode(' ', $classes);
      if (isset($this->htmlOptions['class']))
        $this->htmlOptions['class'] .= ' '.$classes;
      else
        $this->htmlOptions['class'] = $classes;
    }
  }

  /**
   * Returns the divider css class.
   * @return string the class name
   */
  public function getDividerCssClass()
  {
    return (isset($this->type) && $this->type === self::TYPE_LIST) ? 'divider' : 'divider-vertical';
  }

  /**
   * Returns the dropdown css class.
   * @return string the class name
   */
  public function getDropdownCssClass()
  {
    return 'dropdown';
  }

  /**
   * Returns whether this is a vertical menu.
   * @return boolean the result
   */
  public function isVertical()
  {
    return isset($this->type) && $this->type === self::TYPE_LIST;
  }
}


Perhaps some PHP extensions are missing, but something intelligible was not found.
Tell me which way to dig, please. Thank you all in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin, 2022-01-28
@BHop

Kind people suggested the idea about incorrect paths and in fact they turned out to be inaccurate: the site had 2 files TbBaseMenu.php in the location /protected/extensions/bootstrap2/widgets and in /protected/extensions/bootstrap/widgets , and upon closer inspection one of these files (which is in the bootstrap subdirectory) turned out to be empty, the error referred exactly to it, copied its contents from the full TbBaseMenu.php (from the bootstrap2 subdirectory) - and everything flew.
PS It remains unclear why the transfer file became empty and / or how it all worked on the previous hosting, which was on VDS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question