Share » Forums » Developer » Webdav and eZ 4.1.1? (404 error)

Webdav and eZ 4.1.1? (404 error)

Webdav and eZ 4.1.1? (404 error)

Sunday 03 January 2010 3:30:22 pm - 10 replies

Author Message

Jérôme Vieilledent

Wednesday 06 January 2010 5:08:08 am

Hello Nicklas

I am guessing you use Internet Explorer as a webdav client ?

I already had problems with last versions of IE and webdav because it REALLY doesn't like special chars... This stopped me using Webdav against MultiFileUpload extension...

Nicklas Lundgren

Thursday 07 January 2010 1:13:14 am

Hello again,

Thanks for your reply, Jérôme. However, I have tried several Windows and Linux based clients with the same result.

I have now found the core of the problem.

It´s in row 3177 (public static function virtualContentFolderName()) of the file kernel/private/classes/webdav/ezwebdavcontentbackend.php.

I have been wondering where the virtual content folder were translated to the swedish word for Content - "innehåll", and this row takes care of that:

return ezi18n( 'kernel/content', 'Content' );

However, since the content node is NOT translated in the systems database, a subequent call to /webroot/Innehåll will render a 404 error. The call has to be done to /webroot/Content, of course. As Content is the name of the node.

I changed the line to

return  'Content';

And now it is working. So far... Also, the Media folder is empty in webdav. Thats my next problem... It´s obvious that the webdav functionality isn´t ready for commercial use in the shape it´s in today.

Best regards,

/Nicklas

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Jérôme Vieilledent

Thursday 07 January 2010 2:10:18 am

I'm happy you found the origin of this problem... Can you please report this bug on the issue tracker ?

Curiosity : Which webdav clients did you try ?

Russell Michell

Monday 11 January 2010 1:09:04 pm

Hi Jérôme,

I have replicated the issue of not seeing the 'Media' folder in webdav and have added a ticket: http://issues.ez.no/IssueView.php?Id=16023

FWIW I used the following clients with the same result:

Konqueror 4.1.3 (Linux FC9)
WebDrive 9.1 (Win XP SP3)
NetDrive 1.0.8.15 (Win XP SP3) 

Cheers Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Nicklas Lundgren

Monday 11 January 2010 3:12:33 pm

Hi Russel and Jérôme!

Sorry for the delay with my response about this issue. It appears to be a never ending quest to make Webdav work on eZ 4.1.1.

I have been occupied with continuous reserach for error after error appearing...

As I mentioned above, I couldnt see anything below the virtual Media node. This took a while to sort out, but I have now solved the problem. It turned out to be a mismatch in constants names. Let me be more specific.

Have a look at the file kernel/private/classes/webdav/ezwebdavcontentbackend.php

Right after the class definition we have code setting constants like this:

/**     * The name of the content folder in eZ Publish.     */
const VIRTUAL_CONTENT_FOLDER_NAME = 'Content';
/**     * The name of the media folder in eZ Publish.     */
const VIRTUAL_MEDIA_FOLDER_NAME = 'Media';

From this one could assume that these constants would be used when referencing the virtual folders in webdav. And my experience until now is that the constants are also used to fetch nodes from the Db (correct me if I am wrong...)

If so, since we are in eZ 4, the media folder should be referenced 'media', not 'Media'.

I changed this, but nothing happened. After a long adventure into the ezc/Webdav I found my way back to row 3182 in kernel/private/classes/webdav/ezwebdavcontentbackend.php

/**     * The name of the media folder in eZ Publish, translated.
*
* @return string
*/
public static function virtualMediaFolderName()    {
return ezi18n( 'kernel/content', 'Media' );    }
/**     * The name of the media folder in eZ Publish, translated.
*
* @return string
*/

Please note that the Media folder name is hardcoded here. I wonder why the constant mentioned above wasnt used....

Also, here as well, Media, when is should have been media...

Another thing, I dont understand how the ezi18n can be right to use here. See my problem with the content node above in this thread.

Maybe I just dont understand, but how can it be correct to translate the node and then later on try to fetch from the db the translated value? It surely is not translated there...

After my corrections, I got the Media part working but there were more problems to come.

Let me get back with more info, but the function internalNodePath in the same file is a little worrying.To begin with, also here the Media folder is hardcoded as a string. However here with the correct format.

But I am more troubled with the way the method returns paths, primarily in the media part.In our system we use pathprefixes, set up in Site.ini.

The code cant possibly be written with pathprefixes in mind. At least I couldnt publish anything with webdav to the media folder without tweaking this function. I will get back with more info when I am sure of what I am doing... :-)

Also - please note that if you are using pathprefixes, you MUST use

PathPrefixExclude[]=media

In your override/site.ini. Otherwise it wont work.

The need for the PathPrefixExclude should really be mentioned in the documentation. I havent seen a trace of it anywhere...

So - is that it?

Not by far, I am afraid.

Now I am struggling with problems moving and copying nodes in webdav.

Both these actions do work - the node gets copied or gets moved. However, in the same process the webserver returns a HTTP 500 status, like this:

(Moving an image, apache access log)

192.168.11.83 - user [11/Jan/2010:23:51:29 +0100] "MOVE /customer/media/bilder/bild_3.png HTTP/1.1" 500 69 "-" "Microsoft Data Access Internet Publishing Provider DAV 1.1"

So the move action, consisting of a copy action followed by a delete action works perfectly. But what is it that is sending the 500 "Internal Server Error" repsonse code? I dont have a clue and it is driving me crazy...

All ideas that might lead in whatever useful direction are welcome... And as you all can see, the webdav functionality in eZ is far from ready for your customer project.

To be continued...

Best regards

/Nicklas

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Jérôme Vieilledent

Tuesday 12 January 2010 12:08:44 am

Hi Nicklas

I think it would be useful that you add a comment in the issue ;)

Nicklas Lundgren

Tuesday 12 January 2010 1:25:32 am

Hi Jérôme,

Yes, I will add to Russels issue when I have the full picture of the problems.

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Russell Michell

Tuesday 16 March 2010 2:51:28 pm

Hi there Nicklas,

Have you got any more of your WebDAV findings to add to the ticket? (http://issues.ez.no/IssueView.php?Id=16023)

Please do add them to the ticket so the eZ dev's have lots of info to work from.

Cheers,
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Russell Michell

Wednesday 17 March 2010 6:09:20 pm

For those struggling to get WebDAV to work, and all you needed if for was multi-file upload. Look at the ezmultiupload extension.

It works great.

I added some patches in the forum to enable user-selected upload destinations, which may or may not make it (in a slightly more refined form) to the main project.

Cheers
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Steven E. Bailey

Thursday 18 March 2010 2:52:10 am

If ezmultiupload doesn't work for you because of too large size files, take a look at http://projects.ez.no/plupload

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu