jazz_aaf
Well-known member
Hi,
I have created a new custom table in the database. The relation between the new table and the AttachmentData table was added like the following:
The same was added to the entity "AttachmentData":
In the "attachment_macros" template, the new table values are only available for the attachments of the first post of the thread, and "NULL" for attachments of the replies in the same thread.
Any idea why this is happening?
Thank you.
I have created a new custom table in the database. The relation between the new table and the AttachmentData table was added like the following:
Code:
$structure->relations =
[
'AttachmentData' => [
'entity' => 'XF:AttachmentData',
'type' => self::TO_ONE,
'conditions' => 'data_id',
'primary' => true
]
];
The same was added to the entity "AttachmentData":
Code:
public static function getStructure(Structure $structure)
{
$structure = parent::getStructure($structure);
$structure->relations = array_merge(
$structure->relations,
[
'AttachmentCheck' => [
'entity' => 'Jazzaaf\AttachmentCheck:AttachmentCheck',
'type' => self::TO_ONE,
'conditions' => 'data_id',
'primary' => true
],
]
);
In the "attachment_macros" template, the new table values are only available for the attachments of the first post of the thread, and "NULL" for attachments of the replies in the same thread.
Any idea why this is happening?
Thank you.