django-nested-admin icon indicating copy to clipboard operation
django-nested-admin copied to clipboard

Regexp is not replacing __prefix__ with object when string is used as argument for inline js function

Open danielce opened this issue 6 years ago • 2 comments

django-nested-admin > 3.1.4 is not working correctly with django-filebrowser. It is due to changed regexp for replacing prefix with id of the object. Django-filebrowser uses this rendered id as argument for function to show filebrowser window. It seems that new regexp is not handling replacing string if that string is used inside js function call - see the example below:

<input id="id_cad_models-10-file" type="text" class="vFileBrowseField" name="cad_models-10-file" value=""><a href="javascript:FileBrowser.show('id_cad_models-__prefix__-file', '/admin/filebrowser/browse/?pop=1&amp;dir=products');" class="fb_show"></a> Tested with configuration as follows: django-nested-admin==3.2.4 django-filebrowser==3.12.1 Django==2.2.7

danielce avatar Feb 06 '20 12:02 danielce

Thanks for the bug report. Could you post a simplified example of how you're using filebrowser inside an inline, so I can write a regression test for this?

fdintino avatar Feb 10 '20 18:02 fdintino