This was working in 3.5.14 but stopped when upgraded to 4.0.7
I have a simple form with a file input. When I use {field:headshot} it works without an issue. Anytime I use the tag pair {headshot}{file_name}{/headshot} I get a fatal error.
Warning
Attempt to assign property of non-object
ee/EllisLab/Addons/channel/libraries/channel_form/Channel_form_lib.php, line 3224
Severity: E_WARNING
Fatal error: Uncaught TypeError: Argument 1 passed to Api_channel_fields::custom_field_data_hook() must be an instance of EE_Fieldtype, string given, called in /home/fap/new/system/ee/legacy/libraries/api/Api_channel_fields.php on line 405 and defined in /home/fap/new/system/ee/legacy/libraries/api/Api_channel_fields.php:1612 Stack trace:
#0 /home/fap/new/system/ee/legacy/libraries/api/Api_channel_fields.php(405): Api_channel_fields->custom_field_data_hook('File_ft', '_init', Array)
#1 /home/fap/new/system/ee/EllisLab/Addons/channel/libraries/channel_form/Channel_form_lib.php(3230): Api_channel_fields->apply('_init', Array)
#2 /home/fap/new/system/ee/EllisLab/Addons/channel/libraries/channel_form/Channel_form_lib.php(401): Channel_form_lib->replace_tag('headshot', NULL, Array, '\n\t\t\t\t<label>Cur...')
#3 /home/fap/new/system/ee/EllisLab/Addons/channel/mod.channel.php(5448): Channel_form_lib->entry_form()
#4 /home/fap/new/system/ee/legacy/libraries/Template.php(1810): Channel->form()
#5 /home/fap/new/system/ee/legacy/lib in /home/fap/new/system/ee/legacy/libraries/api/Api_channel_fields.php on line 1612
In system/ee/EllisLab/Addons/channel/libraries/channel_form/Channel_form_lib.php
on line 3222 you will see:
ee()->api_channel_fields->field_type = $this->get_field_type($field_name);
Immediately after that, add:
if ( ! is_object(ee()->api_channel_fields->field_types[ee()->api_channel_fields->field_type]))
{
ee()->api_channel_fields->include_handler(ee()->api_channel_fields->field_type);
$fieldtype = ee()->api_channel_fields->setup_handler(ee()->api_channel_fields->field_type, TRUE);
ee()->api_channel_fields->field_types[ee()->api_channel_fields->field_type] = $fieldtype;
}
ExpressionEngine implements Markdown Extra and BBCode. Please see the Markdown Extra docs and the BBCode Wikipedia article for a full reference.
**bold**
, __bold__
, *italics*
, _italics_
, ~strike/del~
, `code()`
bold, italics, strike/del, code()
Link: [link title](https://example.com)
Image: ![alt text](https://example.com/image.jpg)
[blockquote]...[/blockquote]
, [quote]...[/quote]
, and Markdown style:
> Some quoted text. > > This is all one quote.
[code]...[/code]
, and you can also specify the language for syntax highlighting, [code=php]...[/code]
GitHub flavored Markdown code fences are also supported:
``` public function decoderRing($str) { return str_rot13($str); } ```