Bug 387073 - Cannot create New Folder
Summary: Cannot create New Folder
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-18 15:50 UTC by Christoph Feck
Modified: 2018-04-05 07:26 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Feck 2017-11-18 15:50:34 UTC
Using Dolphin from master at a1108e84009f6e6c6f8b99553defb547d6559b4b

Steps to reproduce:
- Start Dolphin in default Home directory
- Right-click the context menu in free space, select "Create New > Folder", click "OK"

Actual result:
- Red error bar with "Malformed URL ." is displayed

Expected result:
- "New Folder" is created

Additional information:
- Using 'mkdir' from F4 Konsole works fine in the same directory
- Dolphin was compiled without baloo support
Comment 1 Elvis Angelaccio 2017-11-18 15:54:57 UTC
See https://phabricator.kde.org/D8836
Comment 2 Christoph Feck 2017-11-18 15:59:52 UTC
The commit referenced in comment #1 fixed it, merci.
Comment 3 Nate Graham 2017-11-18 17:03:15 UTC
Can we mark this as resolved, then?
Comment 4 Elvis Angelaccio 2017-11-18 19:06:27 UTC
Yes.
Comment 5 Martin Schnitkemper 2017-11-27 09:24:39 UTC
It's not really fixed, since I have the same problem while trying to create any item (not limited on folders) on the KDE-Desktop, such as a new file, folder or link.  Actions are refused with the comment of invalid url.

In Dolphin it works after applying the latest patch, but not on the desktop.
Comment 6 Elvis Angelaccio 2017-11-27 10:11:49 UTC
Right, it seems Folder View is still affected :/
Comment 7 Elvis Angelaccio 2017-11-27 10:35:12 UTC
foldermodel.cpp uses KNewFileMenu just like dolphin does, so I don't really understand why it works in dolphin but not in plasma.
Comment 8 Elvis Angelaccio 2017-11-27 11:23:14 UTC
Re-assigning to plasma. It seems the desktop ioslave needs to be adjusted (you can reproduce the bug also in dolphin if you go to the desktop:/ URL).
Comment 9 Eike Hein 2017-11-28 10:58:48 UTC
This bug is in KIO, not in Plasma (or the ioslave). Patch:

https://phabricator.kde.org/D9029
Comment 10 Eike Hein 2017-11-28 11:40:22 UTC
Git commit 298c0e734efdd8a7b66a531959e3fb5357a6495d by Eike Hein.
Committed on 28/11/2017 at 10:50.
Pushed by hein into branch 'master'.

Fix creating a directory via KNewFileMenu+KIO::mkpath on Qt 5.9.3+

Summary:
f62768d04652 in qtbase.git introduced a behavior change in QUrl
causing it to reject URLs with a path of "//foo" (note the double
slash) as invalid.

Both KNewFileMenu and KIO::mkpath contained code following this
pattern:

  url.path() + '/' + name

This is a bad mix with forwarding slaves like kio_desktop, which
translate a top-level path of / to some other URL:

  (desktop:)/ + / + foo = //foo

This patch addresses the two instances of this by wrapping the
string building in QDir::cleanPath, which I think is the shortest
and most readable way to go.

2353119aae8f in kio.git (D8836) was another commit fixing fallout
from this Qt change. Is unlikely this patch will be the last one.
I suspect many other variations of this problem lurk about the
codebase.

Reviewers: dfaure, thiago, elvisangelaccio

Subscribers: #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D9029

M  +2    -1    src/core/mkpathjob.cpp
M  +1    -1    src/filewidgets/knewfilemenu.cpp

https://commits.kde.org/kio/298c0e734efdd8a7b66a531959e3fb5357a6495d
Comment 11 Martin Schnitkemper 2017-11-28 19:02:49 UTC
Creating a new folder on the desktop is now possible afer applying the patch, but I still run into the same malformed URL message if I try to create a new file, or a link on the desktop.

Should I file a new bug report for this issue, or you prefer to re-open this one?
Comment 12 Eike Hein 2017-11-29 10:28:16 UTC
I'll let the KIO maintainer decide. After demonstrating that it's a KIO issue and not in FV, I'd like the KIO folks to do the next steps as I'll be travelling starting tomorrow and all next week and can't work on this in a timely manner.
Comment 13 Nate Graham 2017-12-03 04:12:34 UTC
*** Bug 387529 has been marked as a duplicate of this bug. ***
Comment 14 Pulfer 2017-12-06 12:26:08 UTC
> Should I file a new bug report for this issue, or you prefer to re-open this
> one?

Now we also have https://bugs.kde.org/show_bug.cgi?id=387529 but it's marked as RESOLVED DUPLICATE. IMHO, we should have at least one of these bugs open until the issue is fixed.