Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix database type identification
  • Loading branch information
Fasse committed Jan 20, 2022
1 parent f602835 commit 1ff30f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions adm_program/modules/photos/photo_album_new.php
Expand Up @@ -115,7 +115,7 @@ function subfolder($parentId, $vorschub, TablePhotos $photoAlbum, $phoId)
$form->addInput(
'pho_name',
$gL10n->get('PHO_ALBUM'),
$photoAlbum->getValue('pho_name'),
$photoAlbum->getValue('pho_name', 'database'),
array('property' => HtmlForm::FIELD_REQUIRED, 'maxLength' => 50)
);
subfolder(0, '', $photoAlbum, $photoAlbum->getValue('pho_id'));
Expand Down Expand Up @@ -145,13 +145,13 @@ function subfolder($parentId, $vorschub, TablePhotos $photoAlbum, $phoId)
$form->addInput(
'pho_photographers',
$gL10n->get('PHO_PHOTOGRAPHER'),
$photoAlbum->getValue('pho_photographers'),
$photoAlbum->getValue('pho_photographers', 'database'),
array('maxLength' => 100)
);
$form->addMultilineTextInput(
'pho_description',
$gL10n->get('SYS_DESCRIPTION'),
$photoAlbum->getValue('pho_description'),
$photoAlbum->getValue('pho_description', 'database'),
6,
array('maxLength' => 4000)
);
Expand Down
6 changes: 5 additions & 1 deletion adm_program/system/classes/TableAccess.php
Expand Up @@ -627,7 +627,11 @@ protected function setColumnsInfos()
}
}
$this->columnsInfos[$columnName]['changed'] = false;
$this->columnsInfos[$columnName]['type'] = $property['type'];
if(strpos($property['type'], '(') > 0) {
$this->columnsInfos[$columnName]['type'] = substr($property['type'], 0, strpos($property['type'], '('));
} else {
$this->columnsInfos[$columnName]['type'] = $property['type'];
}
$this->columnsInfos[$columnName]['null'] = $property['null'];
$this->columnsInfos[$columnName]['key'] = $property['key'];
$this->columnsInfos[$columnName]['serial'] = $property['serial'];
Expand Down
2 changes: 0 additions & 2 deletions adm_program/system/classes/TablePhotos.php
Expand Up @@ -179,8 +179,6 @@ public function deleteInDatabase($photoId)
*/
public function getValue($columnName, $format = '')
{
global $gL10n;

if ($columnName === 'pho_description' && $format === 'html') {
$value = nl2br(parent::getValue($columnName));
} else {
Expand Down

0 comments on commit 1ff30f7

Please sign in to comment.