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

Fix type error for missing organization property #715

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

lkiesow
Copy link
Member

@lkiesow lkiesow commented Jun 19, 2024

If an organization property does not exist, the admin interface completely breaks in some cases. This seems to happen on admin-interface.opencast.org right now:

Uncaught TypeError: u.toLowerCase is not a function
    qr Footer.tsx:25
    React 8
    D scheduler.production.min.js:13
    $ scheduler.production.min.js:14
Footer.tsx:25:80

What's interesting is that this only seems to happen with the compiled code. Starting the development server, calling toLowerCase() just works.

In any case, this patch fixes the issue by providing the default value first, so that toLowerCase() is always called on a string.

If an organization property does not exist, the admin interface
completely breaks in some cases. This seems to happen on
admin-interface.opencast.org right now:

```
Uncaught TypeError: u.toLowerCase is not a function
    qr Footer.tsx:25
    React 8
    D scheduler.production.min.js:13
    $ scheduler.production.min.js:14
Footer.tsx:25:80
```

What's interesting is that this only seems to happen with the compiled
code. Starting the development server, calling `toLowerCase()` just
works.

In any case, this patch fixes the issue by providing the default value
first, so that `toLowerCase()` is always called on a string.
@lkiesow lkiesow added the type:bug Something isn't working label Jun 19, 2024
Copy link
Contributor

This pull request is deployed at test.admin-interface.opencast.org/715/2024-06-19_15-47-48/ .
It might take a few minutes for it to become available.

Copy link
Contributor

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-715

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/opencast-admin-interface:pr-715

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

Copy link
Member

@JulianKniephoff JulianKniephoff left a comment

Choose a reason for hiding this comment

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

Chaning my review to a "comment;" see #715 (comment)

@Arnei Arnei merged commit 2d359fd into opencast:main Jun 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants