Skip to content

edited common.php for website to show Swiss lines as well - #395

Draft
luna-cant-code wants to merge 18 commits into
Traewelling:mainfrom
luna-cant-code:swiss-website
Draft

edited common.php for website to show Swiss lines as well#395
luna-cant-code wants to merge 18 commits into
Traewelling:mainfrom
luna-cant-code:swiss-website

Conversation

@luna-cant-code

Copy link
Copy Markdown
Collaborator

Uhm...I hope this works; I couldn't test it to be honest.

As you all know: I can't code, this is just me sending it and hoping for the best.
Added comments so you understand my thought process

@luna-cant-code luna-cant-code added the 🌐 website Changes to the website label Dec 19, 2025
@luna-cant-code

Copy link
Copy Markdown
Collaborator Author
Run php test.php
PHP Parse error:  syntax error, unexpected variable "$linesByOperatorCode" in /home/runner/work/line-colors/line-colors/validation/common.php on line 24

Yeah mate, I don't know. That variable looks good to me, I didn't touch it o.O
Any ideas?

maybe it solves the problem, idk
@luna-cant-code

Copy link
Copy Markdown
Collaborator Author

i feel so dumb. thanks!

@wittighausen

Copy link
Copy Markdown
Collaborator

Okay, the previous error isn't there after my contribution but now there's another one ._.

@luna-cant-code

Copy link
Copy Markdown
Collaborator Author

I think it might have something to do with the missing Hafas values in the Swiss CSV file; that's basically the only "drastic" change I could think of resulting in this error

@luna-cant-code

Copy link
Copy Markdown
Collaborator Author

i'm just gonna leave it for the day

@luna-cant-code

Copy link
Copy Markdown
Collaborator Author

It was worth a shot though! Thank you soooo much!!!!

@wittighausen

wittighausen commented Dec 20, 2025

Copy link
Copy Markdown
Collaborator

As much as I understood from my attempts, the problem after fixing the mismatching column count issue is the sorting by shortOperatorName. In the current code, both .csv files are merged first and then checked for the correct alphabetical order, which is incorrect afterwards. As a result, the error appears during the check for line-colors.csv, but not in the PHP code, which seems to be correct.

To be precise, this error appeared after commit #c86e955:

Run php check.php
Checking for lower-case content
Checking for ordering by shortOperatorName
PHP Fatal error:  Uncaught Error: zvnl-tram should be after liemobil in row 3930 in /home/runner/work/line-colors/line-colors/validation/check.php:23
Stack trace:
#0 {main}
  thrown in /home/runner/work/line-colors/line-colors/validation/check.php on line 23
Error: Process completed with exit code 255.

@luna-cant-code

Copy link
Copy Markdown
Collaborator Author

As much as I understood from my attempts, the problem after fixing the mismatching column count issue is the sorting by shortOperatorName. In the current code, both .csv files are merged first and then checked for the correct alphabetical order, which is incorrect afterwards. As a result, the error appears during the check for line-colors.csv, but not in the PHP code, which seems to be correct.

To be precise, this error appeared after commit #c86e955:

Run php check.php
Checking for lower-case content
Checking for ordering by shortOperatorName
PHP Fatal error:  Uncaught Error: zvnl-tram should be after liemobil in row 3930 in /home/runner/work/line-colors/line-colors/validation/check.php:23
Stack trace:
#0 {main}
  thrown in /home/runner/work/line-colors/line-colors/validation/check.php on line 23
Error: Process completed with exit code 255.

I'm gonna try sorting after combining. Don't know how but it should be possible!

@luna-cant-code
luna-cant-code marked this pull request as draft December 21, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌐 website Changes to the website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants