Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
I am trying to upload an image for the following repeatable region:

Code: Select all
      

<cms:repeatable name='repeatable_region_list' >
            <cms:editable label='My Name' name='my_name' type='text'  />
            <cms:editable name='My Image' label='my_image' type='image'  />
            <cms:editable label='My Description' name='my_description' type='text' />
            <cms:editable label='My URL' name='my_url' type='text' />
         </cms:repeatable>


From the couch application, I click on the 'Browse Server' underneath the 'My_Image' header, which pops up the file chose dialogue.
Then when I click on an image, nothing happens, the Chrome console has the following error message:

Code: Select all
Uncaught TypeError: Cannot call method 'set' of null 

Which comes from the function:

Code: Select all
 function k_browse_result( id, fileurl ){
                        $(id).set( 'value', fileurl );


The 'id' and 'fileurl' are both populated, $(id) is not finding anything.

The strange thing is, if I do this through a cloneable region, using the exact same
Code: Select all
<cms:editable name='My Image' label='my_image' type='image'  />
the image uploads as expected.
Using the following version...
Code: Select all
CouchCMS - Simple Open-Source Content Management v1.3.5 (build 20130616)
Code: Select all
<cms:editable name='My Image' label='my_image' type='image'  />


I had the name and the label the wrong way around, the space in the name was causing the issue.
Hello and welcome Kirk :)

I am glad you found the reason causing the problem.
What puzzles me is that you remarked -
The strange thing is, if I do this through a cloneable region, using the exact same
Code:
<cms:editable name='My Image' label='my_image' type='image' />
the image uploads as expected.

Now with normal editable regions (i.e. not repeatable), Couch should have thrown an explicit error given the malformed name. Can you please repeat it and verify?

As for the repeatable regions, I checked and yes, there is no error being thrown informing the user about the mistake.
This can be regarded as a bug.
I have made the necessary modification to the code to rectify this.

Thank you very much for reporting the issue :)
Hi KK,

Just had a quick look, turns out my standard editable region had the name and the label the correct way round, which is why it was working.

If I add a space to the 'name' property then I do get the error message you mention:

Code: Select all
ERROR: Tag "editable": 'name' contains invalid characters. (Only lowercase[a-z], numerals[0-9] and underscore permitted. The first character cannot be a numeral)


Thanks again for your help :)
4 posts Page 1 of 1