Yii Framework Forum: Substr_Compare(): The Length Must Be Greater Than Zero - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Substr_Compare(): The Length Must Be Greater Than Zero gii model generator Rate Topic: -----

#1 User is offline   Kostromich 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 31-July 14

Posted 31 July 2014 - 06:40 AM

Yesterday i'v updated yii and today get an exception "substr_compare(): The length must be greater than zero".
I'v found two issues on github /yiisoft/yii2/issues/4526 and /yiisoft/yii/issues/3469.
Exception page is attached.
ty

Attached File(s)


0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,641
  • Joined: 17-January 09
  • Location:Russia

Posted 31 July 2014 - 01:00 PM

Update once again. I've fixed it.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   Kostromich 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 31-July 14

Posted 01 August 2014 - 02:31 AM

Ty but there is another 'bug' with generated labels
public function attributeLabels()
    {
        return [
            'id' => Yii::t('common/shop', 'ID'),
            'partner_id' => Yii::t('common/shop', 'Partner Id'),
            'name' => Yii::t('common/shop', 'N ID'),
            'code' => Yii::t('common/shop', 'C ID'),
            'lon' => Yii::t('common/shop', ' ID'),
            'lat' => Yii::t('common/shop', ' ID'),
            'country_id' => Yii::t('common/shop', 'Country Id'),
            'region_id' => Yii::t('common/shop', 'Region Id'),
            'city_id' => Yii::t('common/shop', 'City Id'),
            'address' => Yii::t('common/shop', 'Addr ID'),
            'mall_name' => Yii::t('common/shop', 'Mall N ID'),
            'description' => Yii::t('common/shop', 'Descript ID'),
            'logo' => Yii::t('common/shop', 'L ID'),
            'is_active' => Yii::t('common/shop', 'Is Act ID'),
            'status_id' => Yii::t('common/shop', 'Status Id'),
        ];
    }

from that structure
CREATE TABLE `shop` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `partner_id` int(11) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `lon` decimal(9,6) DEFAULT NULL COMMENT 'Долгота',
  `lat` decimal(9,6) DEFAULT NULL COMMENT 'Широта',
  `country_id` int(11) unsigned NOT NULL,
  `region_id` int(11) unsigned NOT NULL,
  `city_id` int(11) unsigned NOT NULL,
  `address` varchar(255) NOT NULL,
  `mall_name` varchar(255) DEFAULT NULL COMMENT 'Торговый центр',
  `description` text,
  `logo` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '0',
  `status_id` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_shop_1_idx` (`partner_id`),
  KEY `fk_shop_2_idx` (`status_id`),
  KEY `fk_shop_3_idx` (`country_id`),
  KEY `fk_shop_4_idx` (`region_id`),
  KEY `fk_shop_5_idx` (`city_id`),
  CONSTRAINT `fk_shop_1` FOREIGN KEY (`partner_id`) REFERENCES `partner` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_shop_2` FOREIGN KEY (`status_id`) REFERENCES `shop_status` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_shop_3` FOREIGN KEY (`country_id`) REFERENCES `country` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `fk_shop_4` FOREIGN KEY (`region_id`) REFERENCES `region` (`id`) ON UPDATE CASCADE,
  CONSTRAINT `fk_shop_5` FOREIGN KEY (`city_id`) REFERENCES `city` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

0

#4 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,641
  • Joined: 17-January 09
  • Location:Russia

Posted 01 August 2014 - 04:59 AM

Fixed as well.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users