Skip to content

Commit

Permalink
[attribute form] Identify drag n drop form layout relation items from…
Browse files Browse the repository at this point in the history
… a pasted configuration as invalid when not tied to the current layer
  • Loading branch information
nirvn committed Nov 29, 2024
1 parent 96fe1ca commit 48d4d5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/vector/qgsattributesformproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,8 @@ QTreeWidgetItem *QgsAttributesDnDTree::addItem( QTreeWidgetItem *parent, const Q

if ( data.type() == QgsAttributesFormProperties::DnDTreeItemData::Relation )
{
const bool isValid = QgsProject::instance()->relationManager()->relation( data.name() ).isValid();
if ( !isValid )
const QgsRelation relation = QgsProject::instance()->relationManager()->relation( data.name() );
if ( !relation.isValid() || relation.referencedLayer() != mLayer )
{
newItem->setText( 0, tr( "Invalid relation" ) );
newItem->setForeground( 0, QColor( 255, 0, 0 ) );
Expand Down

0 comments on commit 48d4d5c

Please sign in to comment.