Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeroen Ribbink 21 posts 50 karma points
    Mar 02, 2011 @ 15:59
    Jeroen Ribbink
    0

    get all media items in 4.5

    hi everyone,

    I'm working on a project. I want to get all media items, and the solluton shown in http://our.umbraco.org/forum/developers/xslt/10706-Getting-ALL-files-from-media-section was working in umbraco 4.0.3.

    Now i upgraded to 4.5.2 and it is not working anymore. there is no output.

    My xslt for getting media looks like this:

    <xsl:for-each select="bmExt:GetRootMedias('false')/descendant::Folder [@level = '1']">

    on another server it works like a charm.

    that server is running windows server 2003 and IIS and i'm currently working with windows XP and IIS.
    The databases are on the same machine(windows 2003 with mssql 2008)

    A little help would be appreciated.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Mar 02, 2011 @ 20:15
    Kim Andersen
    1

    Hi Jeroen

    I don't know what that extension does, but a good way of handling these situations would be to print out the returned XML from the extension.

    Try this:

    <textarea>
    <xsl:copy-of select="bmExt:GetRootMedias('false')" />
    </textarea>

    This will print out the returned XML from the extension and might give you a good idea on how to rund through the nodes. If it still doesn't make any sense to you, please show us the returned XML in here, and we'll find a solution :)

    /Kim A

  • Jeroen Ribbink 21 posts 50 karma points
    Mar 03, 2011 @ 09:41
    Jeroen Ribbink
    0

    hi everyone, i tested some stuf, and put the error message on screen. this is what it shows:

    object reference not set to an instance of the object

    at umbraco.cms.businesslogic.Content.generateXmlWithoutSaving(XmlDocument xd)
       at umbraco.cms.businesslogic.Content.XmlGenerate(XmlDocument xd)
       at umbraco.cms.businesslogic.Content.ToXml(XmlDocument xd, Boolean Deep)
       at getAllMediaItems.getAllMediaItems.GetRootMedias(Boolean Deep)

    and i was able to track the specific function, the following line was generating the error:

    xml.DocumentElement.AppendChild(item.ToXml(xml,true));

    does someone know an answer to my problem?

    thanks in advance

    PS: if you want the full code, look at the post at: http://our.umbraco.org/forum/developers/xslt/10706-Getting-ALL-files-from-media-section

  • Ferdy Hoefakker 214 posts 248 karma points
    Mar 04, 2011 @ 10:24
    Ferdy Hoefakker
    0

    Does anyone know the answer to this? Both Jeroen and I are going crazy over this :P

    On one server it works great, on another it just refuses to work at all! Which leads me to think it might be some server setting somehow, but I have no idea what.

    -Ferdy

  • Kim Andersen 1447 posts 2197 karma points MVP
    Mar 04, 2011 @ 10:58
    Kim Andersen
    0

    Hi guys

    Could you check to see that you have got the same permission settings on both servers. And that you've got the excact same files on the two servers.

    /Kim A

  • Ferdy Hoefakker 214 posts 248 karma points
    Mar 04, 2011 @ 11:20
    Ferdy Hoefakker
    0

    Well, we just synchronized the files, so yes they are the same. Also, the server it's not working on, is our localhost. The working one actually has stricter permissions! We're just baffled and getting quite frustrated :P

    -Ferdy

  • Ferdy Hoefakker 214 posts 248 karma points
    Mar 04, 2011 @ 14:00
    Ferdy Hoefakker
    0

    Allright, we solved the problem! There were some media folders that were causing trouble. We deleted them from the backend, but somehow they still remained in the database. One of our colleagues made them with a database insert query, so possibly something in this way caused an error somewhere. Upon removing these folders from the database, it worked just fine.

    -Ferdy

Please Sign in or register to post replies

Write your reply to:

Draft