diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a368d87 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Handle Release + +on: + release: + types: [created] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write +jobs: + generate: + name: Create release-artifacts + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + repository-projects: write + steps: + - name: Checkout + uses: actions/checkout@v7 + - name: Generate the artifacts + uses: Vba-actions/build-excel-addin@dev + - name: Upload PDF file + uses: actions/upload-artifact@v7 + with: + name: Addin + path: Addin.xlam diff --git a/src/ClassModules/DrupalDatabase.cls b/src/ClassModules/DrupalDatabase.cls index 99c451c..941735f 100644 --- a/src/ClassModules/DrupalDatabase.cls +++ b/src/ClassModules/DrupalDatabase.cls @@ -224,7 +224,7 @@ End Sub ' Get the children of an entity from a one-to-many relationship ' ' Returns: -' A copy of the structure +' An array of children entities Public Function GetChildren(ByVal oEntity As iDrupalEntity, ByVal oField As iDrupalEntity) As iDrupalEntity() Dim sBundle As String sBundle = oEntity.Table @@ -294,9 +294,17 @@ Public Sub Update(oEntity As iDrupalEntity) MySQLDatabase.Execute MyUpdate End Sub -'Create a object with values from the database, using a primary key +' Sub: CreateFromId +' Create an object with values from the database, using a primary key +' +' Parameters: +' oEntity - The labeled entity to populate +' lId - The promary Key ID to use Public Sub CreateFromId(ByRef oEntity As iDrupalEntity, lId As Long) - Dim sSQL As SQLSelect + Dim sSql As SQLSelect + Dim ArrayOfValues As Variant + Dim FieldList As Variant + Dim numfields As Integer Set sSQL = Create_SQLSelect sSQL.Fields = GetFieldNames(oEntity.GetFields) sSQL.Table = oEntity.Table @@ -308,6 +316,9 @@ Public Sub CreateFromId(ByRef oEntity As iDrupalEntity, lId As Long) Dim Item As DrupalField For counter = 0 To numfields Set Item = FieldList(counter) + If IsNull(ArrayOfValues(counter, 0)) Then + ArrayOfValues(counter, 0) = "" + End If Item.Value = ArrayOfValues(counter, 0) Next counter End Sub diff --git a/src/ClassModules/iDrupalEntity.cls b/src/ClassModules/iDrupalEntity.cls index d753e9e..fd50bff 100644 --- a/src/ClassModules/iDrupalEntity.cls +++ b/src/ClassModules/iDrupalEntity.cls @@ -7,6 +7,9 @@ Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = True +' Interface: iDrupalEntity +' The common interface for Drupal Entities + Public Property Get Table() End Property