Skip to content

Commit

Permalink
Fix attachements list of new creating item
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Nov 30, 2016
1 parent f0544c8 commit b90a353
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion inc/links/model/_linkowner.class.php
Expand Up @@ -99,7 +99,14 @@ function __construct( $link_Object, $type, $ID_field_name, $tmp_ID = NULL )
{
$this->ID_field_name = $ID_field_name;
$this->type = $type;
$this->set_object( $link_Object, $tmp_ID );
if( $type == 'message' )
{ // Allow to link files only for new creating message:
$this->set_object( $link_Object, $tmp_ID );
}
else
{ // Others allow to link files only for existing object:
$this->link_Object = $link_Object;
}
}


Expand Down
2 changes: 1 addition & 1 deletion skins_fallback_v5/_edit.disp.php
Expand Up @@ -360,7 +360,7 @@
}
}

if( $edited_Item->get_type_setting( 'allow_attachments' ) )
if( $edited_Item->get_type_setting( 'allow_attachments' ) && $edited_Item->ID > 0 )
{ // ####################### ATTACHMENTS FIELDSETS #########################
$LinkOwner = new LinkItem( $edited_Item );
if( $LinkOwner->count_links() )
Expand Down
2 changes: 1 addition & 1 deletion skins_fallback_v6/_edit.disp.php
Expand Up @@ -399,7 +399,7 @@
}
echo '</div>';
}
if( $perm_view_files )
if( $perm_view_files && $edited_Item->ID > 0 )
{ // If current user has a permission to view files
$LinkOwner = new LinkItem( $edited_Item );
if( $LinkOwner->count_links() )
Expand Down

0 comments on commit b90a353

Please sign in to comment.