Skip to content

Commit

Permalink
fix: pass backwards compatible field types to the template
Browse files Browse the repository at this point in the history
fix #43
  • Loading branch information
live627 committed May 4, 2023
1 parent 82c0a2c commit d8adf63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/CustomForm/CustomForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private function ViewForm(): void

while ($row = $this->smcFunc['db_fetch_assoc']($request))
{
$type = strtr(
$row['type'] = strtr(
$row['type'],
[
'largetextbox' => 'textarea',
Expand All @@ -257,13 +257,13 @@ private function ViewForm(): void
'infobox' => 'info'
]
);
$class_name = 'CustomForm\Fields\\' . ucfirst($type);
$class_name = 'CustomForm\Fields\\' . ucfirst($row['type']);

if (!class_exists($class_name))
fatal_error(
sprintf(
'Param "%s" not found for field "%s" at ID #%s.',
$type,
$row['type'],
$this->smcFunc['htmlspecialchars']($row['text']),
$row['id_field']
),
Expand Down

0 comments on commit d8adf63

Please sign in to comment.