question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server error on admin preview of VirtualSourceObject

See original GitHub issue

https://github.com/lektor/lektor/blob/9ede53d740e76f785babf81cb0cab5c92c9a16c5/lektor/admin/modules/api.py#L134-L141

Should a virtual object be treated differently by the admin UI in regards to the navigation redirect? The highlighted snippet above results in a TypeError: object is not subscriptable on the attributes _path and _alt. Further, if you provide a path, the admin UI will redirect to that path. Which is funny because the error happens while the correct page is being displayed. I believe the correct behaviour is to prevent any further navigation if isinstance(record, VirtualSourceObject)?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
dairikicommented, Mar 30, 2022

Should a Page not return jsonify(exists=True,... instead of jsonify(exists=False,...?

Indeed. I think you maybe missed the not in front of isinstance. 😉

No need for me, I’ll update once its ready.

Great! I’ll close this issue. Feel free to re-open if there’s trouble.

0reactions
relikdcommented, Mar 30, 2022

I’m not sure I understand. Page is a subclass of Record (as is Attachment, Image, etc.) If record is an instance of Page, then isinstance(record, Record) will be true. (A instance of a subclass is also an instance of any superclasses.)

Yes, that is why I ask. Should a Page not return jsonify(exists=True,... instead of jsonify(exists=False,...? I thought a Page should evaluate as it did before? Only virtual objects and assets cause problems, so these two should return False whereas a page should return True? – Or: which records remain if you test for isinstance Record? When does it evaluate to true?

Is it worth back-porting this fix to the 3.3 branch (and making a 3.3.x release)? Or can you work from the master branch for now?

No need for me, I’ll update once its ready.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OSF: "Internal Server Error" Error or 500 Error in Admin ...
No calls found with 500 error in browser's Dev Tools > Network. Reproducible Steps 1. Log into occs-admin and open Preview or 1....
Read more >
Troubleshooting Salesforce Sites Using Administrator Preview ...
To access administrator preview mode: From Setup, enter Sites in the Quick Find box, then select Sites. Click the name of the site...
Read more >
500 internall server error when I am (loged in admin)
Hello there, I have been having 500 internal server error for about 3 months. nowadays it is occurring more often. I am so...
Read more >
How to Fix the 500 Internal Server Error on Your WordPress Site
WordPress 500 Internal Server error can occur on your website that eventually results in downtime. Learn how to fix this error in multiple ......
Read more >
How to Fix the 500 Internal Server Error in WordPress
Simply go to the WordPress admin area and click on 'Plugins'. Now you need to reactivate one plugin at a time until you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found