5

We've got a component with a rich text field. This rich text field contain a whole heap of markup, roughly 1200+ line of code including Javascript.

This markup is rendered as a table each time the page holding the component is published. Each time I update the markup and save it I get an intermittent error:

(80040356) Unable to save item. The item tcm:89-72108 does not exist.

There are no other message in the logs. I've checked the cd_core, cd_deployer, cd_transport and cd_monitor.

There are no other error messages on Event Viewer.

It seems to suggest that the sheer amount of content is causing problems but I'm struggling to pin point where exactly Tridion falls over in order to debug this.

I tried searching for the tcm Id through Tridion and I'm getting another error:

(80040356) Unable to retrieve item with id
Unable to open requested item
The item tcm:89-72108-16 does not exist.

Can anyone please give me an idea of what may have caused this?

Update:

This is the markup that I'm updating to the rich text field.

<form id="label-download" name="label-download">Select: 
    <input type="button" id="selectAllLabelsBtn" value="All Labels" class="btn" onclick="selectAllLabels()"/>
    <input type="button" id="selectAllSafetyDataSheetsBtn" value="All Safety Data Sheets" class="btn" onclick="selectAllSafetyDataSheets()" />
    <input type="button" id="unselectAllBtn" value="Unselect All" class="btn" onclick="unselectAll()" />
    <input type="button" id="downloadBtn" value="Download Selected Files" class="btn" onclick="downloadSelectedFiles()"/>

    <table cellspacing="0" cellpadding="1" border="1" style="max-width: 850px; margin: 0;" title="Download">
        <tbody>
            <tr>
                <th>Product</th>
                <th>Type</th>
                <th colspan="3">Downloads</th>
            </tr>
            <tr>
                <th>
                    <a href="tcm:89-30500"><ProductName></a>
                </th>
                <td><ProductType></td>
                <td>
                    <input type="checkbox" class="label-lbl" name="<ProductName>-Label" />Label
                    <a href="tcm:89-30497" style="display:none">Label</a>
                </td>
                <td>
                    <input type="checkbox" class="label-sds" name="<ProductName>-Safety-Data-Sheet" />Safety Data Sheet
                    <a href="tcm:89-30498" style="display:none">Safety Data Sheet</a>
                </td>
                <td>
                    <input type="checkbox" class="label-tml" name="<ProductName>-List" />List
                    <a href="tcm:89-30499" style="display:none">List</a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="tcm:89-30500"><ProductName></a>
                </th>
                <td><ProductType></td>
                <td>
                    <input type="checkbox" class="label-lbl" name="<ProductName>-Label" />Label
                    <a href="tcm:89-30497" style="display:none">Label</a>
                </td>
                <td>
                    <input type="checkbox" class="label-sds" name="<ProductName>-Safety-Data-Sheet" />Safety Data Sheet
                    <a href="tcm:89-30498" style="display:none">Safety Data Sheet</a>
                </td>
                <td>
                    <input type="checkbox" class="label-tml" name="<ProductName>-List" />List
                    <a href="tcm:89-30499" style="display:none">List</a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="tcm:89-30500"><ProductName></a>
                </th>
                <td><ProductType></td>
                <td>
                    <input type="checkbox" class="label-lbl" name="<ProductName>-Label" />Label
                    <a href="tcm:89-30497" style="display:none">Label</a>
                </td>
                <td>
                    <input type="checkbox" class="label-sds" name="<ProductName>-Safety-Data-Sheet" />Safety Data Sheet
                    <a href="tcm:89-30498" style="display:none">Safety Data Sheet</a>
                </td>
                <td>
                    <input type="checkbox" class="label-tml" name="<ProductName>-List" />List
                    <a href="tcm:89-30499" style="display:none">List</a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="tcm:89-30500"><ProductName></a>
                </th>
                <td><ProductType></td>
                <td>
                    <input type="checkbox" class="label-lbl" name="<ProductName>-Label" />Label
                    <a href="tcm:89-30497" style="display:none">Label</a>
                </td>
                <td>
                    <input type="checkbox" class="label-sds" name="<ProductName>-Safety-Data-Sheet" />Safety Data Sheet
                    <a href="tcm:89-30498" style="display:none">Safety Data Sheet</a>
                </td>
                <td>
                    <input type="checkbox" class="label-tml" name="<ProductName>-List" />List
                    <a href="tcm:89-30499" style="display:none">List</a>
                </td>
            </tr>
            <tr>
                <th>
                    <a href="tcm:89-30500"><ProductName></a>
                </th>
                <td><ProductType></td>
                <td>
                    <input type="checkbox" class="label-lbl" name="<ProductName>-Label" />Label
                    <a href="tcm:89-30497" style="display:none">Label</a>
                </td>
                <td>
                    <input type="checkbox" class="label-sds" name="<ProductName>-Safety-Data-Sheet" />Safety Data Sheet
                    <a href="tcm:89-30498" style="display:none">Safety Data Sheet</a>
                </td>
                <td>
                    <input type="checkbox" class="label-tml" name="<ProductName>-List" />List
                    <a href="tcm:89-30499" style="display:none">List</a>
                </td>
            </tr>
            // I ommitted the rest of the 65+ rows.
        </tbody>
    </table>
</form>
<script type="text/javascript" charset="utf-8" src="https://rawgit.com/Stuk/jszip/master/dist/jszip.min.js"></script>
<script type="text/javascript" charset="utf-8" src="https://rawgit.com/Stuk/jszip-utils/master/dist/jszip-utils.min.js"></script>
<script type="text/javascript" charset="utf-8" src="https://rawgit.com/eligrey/FileSaver.js/master/FileSaver.js"></script>
<script type="text/javascript" charset="utf-8" src="https://rawgit.com/eligrey/Blob.js/master/Blob.js"></script>

<script type="text/javascript">


    function deferredAddZip(url, filename, zip) {
            var deferred = $.Deferred();
            JSZipUtils.getBinaryContent(url, function (err, data) {
                    if(err) {
                            deferred.reject(err);
                    } else {
                            zip.file(filename, data, {binary:true});
                            deferred.resolve(data);
                    }
            });
            return deferred;
    };


    function downloadSelectedFiles() {
            var zip = new JSZip();
            var filesSelected = 0;
            var deferreds = [];
            var totalItems = $('#label-download input[type=checkbox]:checked').size();
            $('#label-download input[type=checkbox]:checked').each(function () {
                    filesSelected++;
                    var $this = $(this);
                    var url = $this.next().attr("href");
                    var filename = $this.attr("name") + "." + url.replace(/.*\./g, "");
                    deferreds.push(deferredAddZip(url, filename, zip));     
                    $("#downloadBtn").attr("value","Download "+ totalItems+" file. Please wait.");
            });
            if(filesSelected != 0) {
                $.when.apply($, deferreds).done(function () {
                    var blob = zip.generate({type:"blob"});

                    // see FileSaver.js
                    saveAs(blob, "Adama-Labels-Download.zip");
                    unselectAll();

                    $("#downloadBtn").attr("value","Download the selected files.");
                }).fail(function (err) {alert("An error occured: /n" + err);});
                    return false;
            }else {
                alert("No file selected. Please select at least one file and try again.");
            };
    };


    function selectAllLabels() {
        $('#label-download input[type=checkbox].label-lbl:unchecked').each(function () {
                $(this).click();
        });
    };


    function selectAllSafetyDataSheets() {
        $('#label-download input[type=checkbox].label-sds:unchecked').each(function () {
            $(this).click();
        });
    };


    function unselectAll() {
            $('#label-download input[type=checkbox]:checked').each(function () {
                    $(this).click();
            });
    };
</script>
4
  • 1
    I don't think it's recommended to have 1200+ line of code in a component with RTF. But do you know if tcm:89-72108 indeed exist or not? My guess is, this tcmid could be migrated from another environment which doesn't exist in your current working environment. If it does, maybe run a search re-index on Tridion_cm
    – Robert Jin
    Commented Oct 15, 2015 at 18:19
  • 1
    Can you post you 'vast' selection of content for this RTF. I presume you're using an RTF as you require component links - even then, as Robert suggests, perhaps you should consider breaking this up into manageable junks. Does the value 72108 exist anywhere in the 1200 line's (ignore the publication ID and the type)? Commented Oct 15, 2015 at 22:32
  • Hi Robert. Thank you for getting back to me. tcm:89-72108 is the component that is currently storing the markup, so yes it exists. I'm aware that it shouldn't have that much content in a rich text field but this is strictly a temporary solution provided until designs are produced so that were able to build a much more robust implementation. I'll try your suggestion of running a search re-index.
    – Tim Alonso
    Commented Oct 16, 2015 at 8:27
  • Hi Dylan. Thank you for your comment. I'll update my question with a sample of the markup included. The value "72108" does not exist in the markup at all.
    – Tim Alonso
    Commented Oct 16, 2015 at 8:29

1 Answer 1

1

I know it is easy to say from my point of view, but I really think you are abusing the RTF field in this case.

I would say the form and checkboxes should be template/view code, and all the Component links you have in there, should be a multi value Component link field in the Schema.

Now the reason why you are getting The item tcm:89-72108 does not exist. is most likely because indeed that item doesn't exits. What is a bit strange is where that error is coming from exactly in the RTF field, but I have a feeling there must really be some xlink reference to tcm:89-72108 in your content.

2
  • Hi Bart. Thank you for getting back to me. I'll investigate your suggestion for the possibility of an existing xlink reference. I'm aware that the rich text field is being used for something that it wasn't really designed for. It was implemented by a third part for a temporary solution. We're hoping to implement a much more robust implementation as soon as possible.
    – Tim Alonso
    Commented Oct 20, 2015 at 15:21
  • Hi Bart. I must have missed it but there was an xlink reference within the content. Thank you for your suggestion.
    – Tim Alonso
    Commented Oct 27, 2015 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.