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

Formatter / ISO / Avoid error on invalid extent #8035

Merged
merged 3 commits into from
May 16, 2024

Conversation

fxprunayre
Copy link
Member

@fxprunayre fxprunayre commented May 14, 2024

Avoid XSL error when all coordinates are not double. eg.

<mri:extent>
            <gex:EX_Extent>
               <gex:geographicElement>
                  <gex:EX_GeographicBoundingBox>
                     <gex:westBoundLongitude>
                        <gco:Decimal>2</gco:Decimal>
                     </gex:westBoundLongitude>
                     <gex:eastBoundLongitude>
                        <gco:Decimal/>
                     </gex:eastBoundLongitude>
                     <gex:southBoundLatitude>
                        <gco:Decimal/>
                     </gex:southBoundLatitude>
                     <gex:northBoundLatitude>
                        <gco:Decimal/>
                     </gex:northBoundLatitude>
                  </gex:EX_GeographicBoundingBox>
               </gex:geographicElement>
            </gex:EX_Extent>
         </mri:extent>

Follow up of #7911

Error:

Error on line 54 of render-functions.xsl:
  FORG0001: Cannot convert string "" to a double

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Avoid XSL error when all coordinates are not double. eg. 

```xml
<mri:extent>
            <gex:EX_Extent>
               <gex:geographicElement>
                  <gex:EX_GeographicBoundingBox>
                     <gex:westBoundLongitude>
                        <gco:Decimal>2</gco:Decimal>
                     </gex:westBoundLongitude>
                     <gex:eastBoundLongitude>
                        <gco:Decimal/>
                     </gex:eastBoundLongitude>
                     <gex:southBoundLatitude>
                        <gco:Decimal/>
                     </gex:southBoundLatitude>
                     <gex:northBoundLatitude>
                        <gco:Decimal/>
                     </gex:northBoundLatitude>
                  </gex:EX_GeographicBoundingBox>
               </gex:geographicElement>
            </gex:EX_Extent>
         </mri:extent>
```


Follow up of #7911

Error:

```
Error on line 54 of render-functions.xsl:
  FORG0001: Cannot convert string "" to a double
```
@fxprunayre fxprunayre added this to the 4.4.5 milestone May 14, 2024
@fxprunayre fxprunayre requested a review from josegar74 May 14, 2024 04:48
Copy link
Member

@josegar74 josegar74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work for me, the full view still get the error.

Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@josegar74 josegar74 merged commit 512b1cc into main May 16, 2024
9 checks passed
@geonetworkbuild
Copy link
Collaborator

The backport to 4.2.x failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply c5e493b51b... Formatter / ISO / Avoid error on invalid extent
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

stdout
Auto-merging web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-functions.xsl
CONFLICT (content): Merge conflict in web/src/main/webapp/WEB-INF/data/data/formatter/xslt/render-functions.xsl

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8035-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick c5e493b51b03274f20a2379c7b330f033a4fd4bd,e92d9116b185b589f56107b2406b7869b9459250,bdc985929e84416a158ef985184865d7a91dbe61
# Push it to GitHub
git push --set-upstream origin backport-8035-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x

Then, create a pull request where the base branch is 4.2.x and the compare/head branch is backport-8035-to-4.2.x.

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

Successfully merging this pull request may close these issues.

None yet

3 participants