Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Bug: FeatureLayer fields with parenthesis fail (w/ in memory data) (4.22) #379

Closed
rustygreen opened this issue Feb 16, 2022 · 2 comments
Assignees
Labels

Comments

@rustygreen
Copy link

The issue
When creating a feature layer from an in memory source (array of graphics), version 4.22 of the JS API will throw an error when using a field with a parenthesis in it (ex: "st_length(shape)").

Expected behavior
It is expected that this field would be supported as this field is a valid field that can be published from ArcGIS Server.

Reproduce the issue
The bug can be demonstrated in the following codepen example:
https://codepen.io/rustygreen/pen/dyZZXMY?editors=1001

If you change the ArcGIS version to 4.21, then it will not throw an error. If you comment out the st_length(shape) field (in the 4.22 version), then the example will work (pointing to that field being the issue).

  const layer = new FeatureLayer({
    id: "4535209429701526",
    title: "USA - Highways",
    source: graphics,
    visibility: true,
    objectIdField: "objectid",
    geometryType: 'polyline',
    fields: [
      {
        alias: "OBJECTID",
        editable: true,
        length: -1,
        name: "objectid",
        nullable: true,
        type: "oid"
      },
      // Comment out the following field and it will work.
      // If you change to version 4.21 it will work with this field.
      {
        alias: "st_length(shape)", // <----------------- THE PROBLEM FIELD
        editable: true,
        length: -1,
        name: "st_length(shape)",
        nullable: true,
        type: "double"
      }
    ],
    spatialReference: {latestWkid: 4326, wkid: 4326}
  });

  map.add(layer);
});

image

@rustygreen rustygreen added the bug label Feb 16, 2022
@rustygreen rustygreen changed the title 🐞 Bug: FeatureLayer fields with parenthesis fail (w/ in memory data) 🐞 Bug: FeatureLayer fields with parenthesis fail (w/ in memory data) (4.22) Feb 16, 2022
@ubatsukh ubatsukh self-assigned this Feb 16, 2022
@ubatsukh
Copy link

Thanks for reporting this issue. I will update you once we install a fix for this.

@ubatsukh
Copy link

Hi there,

We fixed this issue for 4.23. You can test the fix on our next version: https://codepen.io/U_B_U/pen/yLPEYJe?editors=1001

Thanks for reporting this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants