Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inlines problem #9

Open
aronchi opened this issue Aug 26, 2010 · 5 comments
Open

Inlines problem #9

aronchi opened this issue Aug 26, 2010 · 5 comments

Comments

@aronchi
Copy link

aronchi commented Aug 26, 2010

When I try to use a filebrowser in inlines inside admin, it doesn't catch the correct id for the field, because it leaves prefix in the id instead replacing the number of the inline.

@aronchi
Copy link
Author

aronchi commented Aug 26, 2010

I've seen that it returns that error only for new inlines. because inlines.js doesn't replace this piece of code prefix

@wardi
Copy link
Owner

wardi commented Aug 26, 2010

Thank you for the bug report.

I haven't tried using file browser fields in inlines so I'm afraid I can't help much. Sounds like it would also be an issue for upstream.

@egolts
Copy link

egolts commented Dec 3, 2010

I just ran into this and made a quick fix by modifying inlines.js and including it in the page after the original django version. add this bit starting at line 78.

.end()
.filter(function() {
    var el = $(this).next();
    return el.attr("href") && el.attr("href").search(/__prefix__/) >= 0;
}).each(function() {
    var el = $(this).next();
    el.attr("href", el.attr("href").replace(/__prefix__/g, nextIndex));
});

@wardi
Copy link
Owner

wardi commented Dec 17, 2010

great, send me a patch or pull request and I'll include it

@aleray
Copy link

aleray commented Jan 20, 2011

Hi, I have commited a fix (for tabular inlines only at the moment).
The trick is to override the tabular inline template and add a post-add hook in the javascript to correct the field id in the filebrowser function call. See:

aleray@1c3389b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants