Browse Source

Use int value instead of bool

jmontoyaa 8 years ago
parent
commit
a2b24e8fe1

+ 1 - 1
app/Migrations/Schema/V111/Version111.php

@@ -314,7 +314,7 @@ class Version111 extends AbstractMigrationChamilo
         $this->addSql('DELETE FROM settings_options WHERE variable = "visio_use_rtmpt"');
         $this->addSql('DELETE FROM course_module WHERE name = "conference"');
         $this->addSql('ALTER TABLE c_student_publication_assignment CHANGE add_to_calendar add_to_calendar INT NOT NULL;');
-        $this->addSql('ALTER TABLE extra_field ADD visible_to_others TINYINT(1) DEFAULT FALSE, CHANGE visible visible_to_self TINYINT(1) DEFAULT FALSE');
+        $this->addSql('ALTER TABLE extra_field ADD visible_to_others TINYINT(1) DEFAULT 0, CHANGE visible visible_to_self TINYINT(1) DEFAULT 0');
     }
 
     /**

+ 12 - 2
src/Chamilo/CoreBundle/Entity/ExtraField.php

@@ -80,14 +80,14 @@ class ExtraField extends BaseAttribute
     /**
      * @var boolean
      *
-     * @ORM\Column(name="visible_to_self", type="boolean", nullable=true, unique=false, options={"default": false})
+     * @ORM\Column(name="visible_to_self", type="boolean", nullable=true, unique=false)
      */
     protected $visibleToSelf;
 
     /**
      * @var boolean
      *
-     * @ORM\Column(name="visible_to_others", type="boolean", nullable=true, unique=false, options={"default": false})
+     * @ORM\Column(name="visible_to_others", type="boolean", nullable=true, unique=false)
      */
     protected $visibleToOthers;
 
@@ -118,6 +118,16 @@ class ExtraField extends BaseAttribute
      */
     protected $createdAt;
 
+    /**
+     * ExtraField constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->visibleToOthers = 0;
+        $this->visibleToSelf = 0;
+    }
+
     /**
      * Get id
      *