pnp / PnP-Sites-Core

Microsoft 365 Dev PnP Core component (.NET) targeted for increasing developer productivity with CSOM based solutions.
Other
415 stars 642 forks source link

Provisioning: Lookup field not provisioned correctly in May release #1786

Open mkacena opened 6 years ago

mkacena commented 6 years ago

Category

[ x ] Bug [ ] Enhancement

Environment

[ x ] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013

Expected or Desired Behavior

Provision a Lookup field correctly.

Observed Behavior

After upgrading the NuGet to version 2.26.1805.1, the provisioning engine does not correctly provision fields of type Lookup. When the provisioning is complete, the site column's reference to the list is empty and trying to add the column to any list ends with an error.

Running the provisioning with version 2.25.1804.1 provisions the field correctly.

Steps to Reproduce

Create a provisioning template with field definition such as this one and provision the template to a web:

<Field
          ID="{3E1AA947-9A9A-4F8D-9E31-8BF08FC31186}"
          Name="ProEntityPicker"
          DisplayName="Entity"
          Type="Lookup"
          List="Lists/Entities"
          Required="FALSE"
          EnforceUniqueValues="FALSE"
          ShowField="Title"
          UnlimitedLengthInDocumentLibrary="FALSE"
          Group="{localization:Group_Dms}"
          Overwrite="TRUE"
          SourceID="{parameter:SourceId}">
</Field>
jimmywim commented 6 years ago

We've also noticed this issue. Reverting to 2.25 works.

jansenbe commented 6 years ago

We'll have a look at this. Adding @stevebeauge for awareness.

stevebeauge commented 6 years ago

I repro-ed the issue when the List attribute is not a GUID but the web relative Url of the target list. I'll take a look.

jansenbe commented 6 years ago

@mkacena / @jimmywim : Please test with the June release, will be out really soon

mkacena commented 6 years ago

Tested the June release 2.27.1806 and it still does not fully behave as expected:

Scenarios

  1. Clean deployment to a single web

Result: OK

  1. Corrective deployment to a single web

Result: Not working Setup: I had a Lookup field provisioned with bad release 2.26.1805.1. The field was corrupted. After upgrading to release 2.27.1806 and repeating the provisioning, the field did not get fixed. This worked with previous release 2.25.1804.1.

  1. Deployment to a site collection

Result: Not working Setup: I deployed a Lookup field to the root of a site collection with the June release. The field worked as expected in the root web, but not in the subwebs. Again, this worked with the April release. I suspect the engine needs to set up also WebId, not just ListId on a Lookup field.