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

GetLine always returns the first LineID if its expressId not exist #224

Closed
jespa007 opened this issue Oct 4, 2022 · 12 comments
Closed

GetLine always returns the first LineID if its expressId not exist #224

jespa007 opened this issue Oct 4, 2022 · 12 comments

Comments

@jespa007
Copy link
Contributor

jespa007 commented Oct 4, 2022

Hi there,

I found an issue at GetLine ( web-api-browser.js line 54518):

    GetLine(modelID, expressID, flatten = false) {
      let rawLineData = this.GetRawLineData(modelID, expressID); // <-- it always returns the first LineID when expressID not exist
      let lineData = FromRawLineData[rawLineData.type](rawLineData);
      if (flatten) {
        this.FlattenLine(modelID, lineData);
      }
      return lineData;
    }
 

GetLine returns always returns the first LineId when its expressID not exists . This case was happened when I tried to load an IFC that it had some missing relations (Is a not well exported IFC of course).

From my point of view I think that, the normal behaviour, it should be to throw an error or return undefined value.

Cheers and I'm very thankful to have this great piece of software in the community :-)

@jespa007 jespa007 changed the title GetLine always returns IfcOrganization (LineID ==1) if its expressId not exist GetLine always returns the first LineID if its expressId not exist Oct 5, 2022
@aka-blackboots
Copy link
Contributor

::take

@agviegas
Copy link
Collaborator

🟢🟢🟢

::take

Hi, @aka-blackboots! Thanks for taking this bounty! The due date is November 5, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

@aka-blackboots
Copy link
Contributor

::drop

@agviegas
Copy link
Collaborator

🟢🟢🟢

::drop

Hi, @aka-blackboots! Thanks for giving it a try! It’s now once again available for anyone to take.

@BSchafer01
Copy link
Contributor

::take

@agviegas
Copy link
Collaborator

🟢🟢🟢

::take

Hi, @BSchafer01! Thanks for taking this bounty! The due date is November 17, 2022 UTC.

If you need to submit some pull requests (PR) to complete the tasks, make sure that the last and only the last PR has a title that either starts with the bounty ID or is exactly the same as the bounty name. After the PR is merged, this bounty’s status will automatically changed to done.

If you do not need to make a PR, tell the manager @agviegas to run ::done command after your tasks is confirmed to be done.

Good luck!

BSchafer01 added a commit to BSchafer01/web-ifc that referenced this issue Oct 27, 2022
Added a validation check of the ExpressID to ensure it is in the IFC file checking for omitted intermediate ExpressIDs and returns an undefined value if the ExpressID doesn't exist to address ThatOpen#224
QuimMoya added a commit that referenced this issue Oct 27, 2022
#224 GetLine always returns the first LineID if its expressId not exist
@BSchafer01
Copy link
Contributor

::done

@agviegas
Copy link
Collaborator

agviegas commented Nov 1, 2022

🟢🟢🟢

::done

Hi, @BSchafer01! Thanks for your contributions! Please submit an expense to IFC.js Open Collective. Then, tell us the invoice number via the ::expense::_____ command (replace the _____ with the invoice number).

@BSchafer01
Copy link
Contributor

::expense::104189

@agviegas
Copy link
Collaborator

agviegas commented Nov 2, 2022

🔴🔴🔴

::expense::104189

Hi, @BSchafer01! We cannot find a new expense with that invoice number. Please re-check the invoice number and re-send the command using the correct one.

@BSchafer01
Copy link
Contributor

Hi @agviegas I've messed up the flow of the automation I believe. The expense has already been approved. I didn't use the "done" command until the expense was approved on Open Collective. Sorry about the confusion

@agviegas
Copy link
Collaborator

agviegas commented Nov 2, 2022

It's ok!

@beachtom beachtom closed this as completed Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants