Copied to clipboard

Flag this post as spam?

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


  • Stephen 767 posts 2272 karma points c-trib
    Jan 20, 2011 @ 17:57
    Stephen
    0

    Losing images?

    - Create a structure including an ImagePicker.
    - Edit content, click "add", pick an image, add.
    - Click "edit": the image is not set (only "choose")

    It works with text fields, not with images. Probably a MediaPicker initialization issue....

  • Sascha Wolter 615 posts 1101 karma points
    Jan 21, 2011 @ 00:07
    Sascha Wolter
    0

    Hi Stephen,

    thanks for bringing that up. I had to implement a custom http handler in order to get the picked node name back to manually initialize the media picker control on edit. So my guess would be that this is not working for you at the moment, most likely cause is a missing entry in the web.config file (I am using the excellent PackageActionsContrib package to add that entry).

    If you go to http://[your-umbraco-hostname]/umbraco/REST/umbraconodename?id=[an existing node id], what do you get?

    You should also have 2 entries for the handler in your web.config file, one in httpHandlers (IIS6) and one in handlers (IIS7) which hook up TheFarm.Umbraco.EmbeddedContent.UmbracoNodeNameHandler to umbraco/REST/umbraconodename, can you find these?

    Many thanks,

    Sascha

  • Stephen 767 posts 2272 karma points c-trib
    Jan 21, 2011 @ 09:44
    Stephen
    0

    Had no handler in the web.config. Oops.

  • Sascha Wolter 615 posts 1101 karma points
    Jan 21, 2011 @ 09:50
    Sascha Wolter
    0

    Can you re-install it to see if the package action works this time on your machine?

  • Sascha Wolter 615 posts 1101 karma points
    Jan 21, 2011 @ 10:42
  • Stephen 767 posts 2272 karma points c-trib
    Jan 22, 2011 @ 17:08
    Stephen
    0

    @sascha: just to clarify, the package action does work. I had no handler in the web.config, because I do not run the package installer. So I suppose I deserve the pain ;-)

  • Sascha Wolter 615 posts 1101 karma points
    Jan 22, 2011 @ 21:12
    Sascha Wolter
    0

    I'll add the web.config file entries to the package page for everybody who likes to add this package manually. :)

    Thanks for clarification,

    Sascha

  • Matthias 3 posts 23 karma points
    Feb 24, 2011 @ 10:01
    Matthias
    0

    Hi all,

    Despite having made all the necessary entries to the web.config (in IIS6 and IIS7 section), the selected content/media items still don't show on existing items...

    I checked with Firebug and Fiddler what requests are being made while editing and updating items in the backend, and I didn't see any calls to umbraco/REST/umbraconodename being made at all.

    I'm using Umbraco 4.6.1 and version 1.1 of the plugin. I uninstalled an reinstalled the plugin already - unfortunately, this didn't solve my problem...

    Does someone have any other suggestions what I could try?

  • Sascha Wolter 615 posts 1101 karma points
    Feb 24, 2011 @ 12:26
    Sascha Wolter
    0

    Hi Matthias,

    I have implemented a backup solution, which will be used if the handler is not responsive/can't be found. The Embedded Content control will create a new web service when it gets first used at /umbraco/webservices/UmbracoNodeNameService.asmx. When you browse to the url you should see one method, ReadUmbracoNodeName. Can you please verify if that works on your machine?

    Many thanks,

    Sascha

  • Matthias 3 posts 23 karma points
    Feb 24, 2011 @ 14:05
    Matthias
    1

    Hi Sascha

    Thanks for your answer, I checked and the web service is present and working as intended. But the previously selected nodes still didn't show up. I did some further testing and I think I found the reason why: The properties of my items had "bad" aliases. My mediapicker property had an alias of "image" and the one for the contentpicker was called "link". I changed their aliases to "theImage" and "theLink" and suddenly everything worked fine. After some digging around in the javascript code, I could narrow it down to the following javascript function: TheFarm.Umbraco.EmbeddedContent.EditItem

    $(valuexml).find('item').each(function () {
        if ($(this).attr('id') == id) {
            $(this).children().each(function () {
                propertyid = $(this).attr('propertyid');
                value = $(this).text();
                //check for different types
                type = $(this).attr('type');
                if (type == 'Simple editor') {
                    value = $(this).html().replace(/&lt;/gi, '<').replace(/&gt;/gi, '>').replace(/&amp;/gi, '&');
                    EC.FillField(dtdid, value, type, propertyid);
                } else {
                    EC.FillField(dtdid, $(this).text(), type, propertyid);
                }
            });
        }
    });

    And here is what happens: The valuexml variable contains the correct data/item nodes, including the "bad" properties with their respective values. However, inside the .each() loop over the properties, $(this).text() is always an empty string "" for the properties "link" and "image". Also, this is only happening in Firefox and not in IE (the code for IE uses a different way of accessing the properties/xml).

    Changing the aliases of the mentioned properties did the trick for me. But a  solution with javascript would of course be much nicer...

    Cheers,
    Matthias

  • Sascha Wolter 615 posts 1101 karma points
    Feb 25, 2011 @ 07:33
    Sascha Wolter
    0

    Hi Matthias,

    looks like my last reply wasn't properly saved by the forum... Anyway, thanks for your marvellous analysis. To solve the issue hopefully once and for all I've now used another JS library for parsing the XML (http://dojotoolkit.org/), and this one seems to do the trick quite well across all browsers.

    Just uploaded version 1.1.1, unfortunately I get an error when I try to edit the package page, so I'm afraid you'll have to download the package yourself from here. Pleaes let me know if that fixes your issue!

    Thanks again,

    Sascha

  • Matthias 3 posts 23 karma points
    Feb 25, 2011 @ 08:44
    Matthias
    0

    Hi Sascha

    Very nice! Installed version 1.1.1, changed back my property names and everything works fine in IE and Firefox. Thank you for that quick fix!!

    Cheers,
    Matthias

  • Sascha Wolter 615 posts 1101 karma points
    Feb 28, 2011 @ 00:51
    Sascha Wolter
    0

    Sweet, glad it's working for you now! :)

    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft