The identifier fID is missing for a query of Concrete\Core\File\File (5.7)
Permalink
In respinding tohttps://www.concrete5.org/community/forums/customizing_c5/my-custom-... I discovered a problem that I get but he does not, but other have as well (likehttp://www.concrete5.org/community/forums/5-7-discussion/error-when...
I have a new block, and when I add this new block I get
"The identifier fID is missing for a query of Concrete\Core\File\File"
This code is based on the above referenced link and the older posthttp://www.concrete5.org/community/forums/customizing_c5/building-a...
add.php
the echo prints "[]"... so, $fID is does not exist, which seems reasonable as I do noit see it defined anywhere, yes, in boith examples that use this same syntax, $fID DOES exist, and is also not defined anywhere, so I assume it is magically passed
controller.php
db.xml
edit.php
view.php
Any ideas?
Thanks
I have a new block, and when I add this new block I get
"The identifier fID is missing for a query of Concrete\Core\File\File"
This code is based on the above referenced link and the older posthttp://www.concrete5.org/community/forums/customizing_c5/building-a...
add.php
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $al = Loader::helper('concrete/asset_library'); ?> <div class="ccm-ui"> <div class="alert-message block-message info"> <?php echo t("This form is used to add corporate level employees.") ?> </div> <?php echo $form->label('name', t('Name')); echo $form->text('name'); echo $form->label('title', t('Title')); echo $form->text('title'); echo $form->label('biography', t('Biography')); echo $form->text('biography');
Viewing 15 lines of 20 lines. View entire code block.
the echo prints "[]"... so, $fID is does not exist, which seems reasonable as I do noit see it defined anywhere, yes, in boith examples that use this same syntax, $fID DOES exist, and is also not defined anywhere, so I assume it is magically passed
controller.php
<?php namespace Application\Block\CorporateEmployee; use Concrete\Core\Block\BlockController; class Controller extends BlockController { protected $btTable = "btCorporateEmployees"; protected $btInterfaceWidth = "350"; protected $btInterfaceHeight = "300"; public function getBlockTypeName() { return t('Corporate Employees'); } public function getBlockTypeDescription() { return t('This block is used to manage existing & new corporate employees.'); } }
db.xml
<?xml version="1.0"?> <schema version="0.3"> <table name="btCorporateEmployees"> <field name="bID" type="I"> <key /> <unsigned /> </field> <field name="name" type="X2"> <default value="" /> </field> <field name="title" type="X2"> <default value="" /> </field> <field name="biography" type="X2"> <default value="" />
Viewing 15 lines of 20 lines. View entire code block.
edit.php
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); $al = Loader::helper('concrete/asset_library'); ?> <div class="ccm-ui"> <div class="alert-message block-message info"> <?php echo t("This form is used to edit corporate level employees.") ?> </div> <?php echo $form->label('name', t('Name')); echo $form->text('name', $name); echo $form->label('title', t('Title')); echo $form->text('title', $title); echo $form->label('biography', t('Biography')); echo $form->text('biography', $biography);
Viewing 15 lines of 19 lines. View entire code block.
view.php
<?php defined('C5_EXECUTE') or die(_("Access Denied.")) ?> <div class="row full-width"> <div class="row"> <?php echo($fID); ?> <div class="col-lg-7 col-lg-offset-1"> <h3><span class="name"><?php echo($name); ?></span><span class="title"><?php echo($title); ?></span></h3> <hr class="little-orange"> <p><?php echo($biography); ?></p> </div> </div> </div>
Any ideas?
Thanks
the following code needed to be added to the top of add.php and edit.php