godot icon indicating copy to clipboard operation
godot copied to clipboard

Typing into the file's search field prints "Cannot get class 'TextFile'." errors.

Open inhalt120g opened this issue 1 year ago • 5 comments

Tested versions

v4.3.beta1.official [a4f2ea91a] (don't remember seeing it in 4.2.1)

System information

Godot v4.3.beta1 - macOS 14.5.0 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)

Issue description

When I try to use the filter field of the FileSystem panel, the first letter I enter after the field is given focus prints out an error: image

Steps to reproduce

Click somewhere in the Godot editor. Now click on the FileSystem filter field. Start typing. The error will be printed to the console.

Minimal reproduction project (MRP)

Any Godot project.

inhalt120g avatar Jun 17 '24 00:06 inhalt120g

Could be related to:

  • https://github.com/godotengine/godot/issues/85698

Will see what I can find later today

AThousandShips avatar Jun 17 '24 09:06 AThousandShips

I can't reproduce it at a normal project with Godot v4.3.beta (2b11d0ca9) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.5168) - 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz (16 Threads)

I suspect it could be related to certain files and import settings. It would be great if you can upload a MRP that has this issue.

jsjtxietian avatar Jun 19 '24 05:06 jsjtxietian

I can only reproduce this in my current project, not a fresh project. I'm not sure what's causing it but here's some behavior I documented:

  1. One error appears for each individual character entered into filter (with matching results).
  2. Must have res:// or any folder under res:// selected; having 'Favorites' selected won't bring up results, even if you have matching favorite'd files.
  3. The error only appears when there is a matching result after the first character.
  4. Having res:// selected on its own can also produce the error (select 'Favorites', then res:// to produce a single new error, note that you must have text in the filter for this to happen).

Again I don't know how to reproduce this in a new project, so I can't provide an MRP at the moment.

Copying all files from my project to a fresh project, I can reproduce it. So it has something do with the files which come up as matching results, and it has nothing to do with the project.godot file. May still be related to an Editor setting.

tumblewed avatar Aug 26 '24 16:08 tumblewed

Figured it out.

How to recreate:

  1. Click dropdown on FileSystem tab, and select 'Move to Bottom'.
  2. Create a new text file (either inside or outside of Godot editor)
  3. Type the name of the text file into the FileSystem filter tab

MRP (it's just an empty project with a text file; you'll need to move the FileSystem in-editor) textfile-error.zip

tumblewed avatar Aug 26 '24 16:08 tumblewed

I tried to reproduce the error but nothing happens:

https://github.com/user-attachments/assets/e72fa786-c5e7-4f16-89f8-071579c8ccee


Godot v4.3.beta1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21916.2) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

matheusmdx avatar Aug 26 '24 18:08 matheusmdx

Can anyone reproduce this?

AThousandShips avatar Sep 20 '24 15:09 AThousandShips

The same thing is happening to me: new-game-project.zip

Godot v4.3.stable (77dcf97d8) - Windows 10.0.19045 - Vulkan (Forward+) - integrated Intel(R) HD Graphics 630 (Intel Corporation; 31.0.101.2111) - Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz (4 Threads)

dragon3025 avatar Sep 24 '24 02:09 dragon3025

It still occurs on Godot v4.4.dev6.mono.official [1f47e4c4e]

Steps to reproduce. Press right mouse button on a .cfg file type in the file system inspector

Image

MikeSchulze avatar Dec 28 '24 10:12 MikeSchulze

Following the step provided by Mike i was able to reproduce the issue, but for some reason i was unable to reproduce it in the same version as the author, in my case the regression started after the 4.4 dev 3 and was bisected to pr #65585. I'll not ping the pr author yet because my case can be a different issue.

Image

I tested with 4 text formats (txt, xml, cfg and json) and only the json file didn't triggered the error. Also, i was able to stop the error registering the TextFile class in the scene\register_scene_types.cpp, not sure if is a valid fix as this issue didn't happened before but at least can give a idea of what's wrong.


@AThousandShips Should i open a separated issue because the engine version difference or it's fine keep it here?

matheusmdx avatar Jan 11 '25 00:01 matheusmdx

A new issue sounds good!

AThousandShips avatar Jan 11 '25 09:01 AThousandShips

Based on the fix, I determined the conditions required to trigger the bug:

  • File list has to be visible (i.e. file dock's split view)
  • You need to use a non-default editor feature profile

KoBeWi avatar Apr 06 '25 19:04 KoBeWi