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

Issue when using the plugin in a scaffolded view #2

Open
nwittstruck opened this issue May 12, 2012 · 7 comments
Open

Issue when using the plugin in a scaffolded view #2

nwittstruck opened this issue May 12, 2012 · 7 comments

Comments

@nwittstruck
Copy link

Hi,

thanks for the great plugin! I am getting the following stacktrace, when I am calling the tag in a scaffolded view. When I call it in an ordinary view, everything works fine.

I put the following line into /templats/scaffolding/show.gsp

    <bsfu:fileUpload action="upload" controller="image" />

which results in:

| Error 2012-05-12 17:05:29,000 [http-bio-8080-exec-6] ERROR errors.GrailsExceptionResolver  - IllegalArgumentException occurred when processing request: [GET] /backend/product/show/1
Argument [txt] cannot be null or blank. Stacktrace follows:
Message: Error processing GroovyPageView: Error executing tag <bsfu:fileUpload>: Argument [txt] cannot be null or blank
   Line | Method
->> 108 | runTask in /product/show
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Caused by GrailsTagException: Error executing tag <bsfu:fileUpload>: Argument [txt] cannot be null or blank
->>  80 | doCall  in /product/show
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Caused by IllegalArgumentException: Argument [txt] cannot be null or blank
->> 138 | doCall  in org.grails.plugins.bootstrap.file.upload.BootstrapFileUploadTagLib$_closure1$$ENXDLuPg
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   108 | doCall  in product_show$_run_closure2
|   129 | run . . in product_show
|   886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
|   908 | run . . in     ''

Any idea what can cause this issue?

@sarbogast
Copy link
Owner

Absolutely no idea. I've never seen this.

@nwittstruck
Copy link
Author

Have you been able to reproduce it or is something that is unique to my setup?

On 12.05.2012, at 22:27, Sebastien Arbogast
[email protected]
wrote:

Absolutely no idea. I've never seen this.


Reply to this email directly or view it on GitHub:
#2 (comment)

@nwittstruck
Copy link
Author

I have been able to fix this issue by explicitly adding the plugin name to each render call.

renderedList = render(template: "/bootstrapFileUpload/list", model: [filesContainer: filesContainer], plugin: 'bootstrap-file-upload').toString()

Since I got an IllegalArgumentException, and not a GrailsTagException, the code in the Catch-Clause was ignored. But anyway, this is not a real solution :/ I don't know why I have to add it manually.

@sarbogast
Copy link
Owner

This must come from the code I'm using to let users override plugin templates with their own.

try {
    renderedList = render(template: "/bootstrapFileUpload/list", model: [filesContainer: filesContainer]).toString()
} catch (GrailsTagException exc) {
    renderedList = render(template: "/bootstrapFileUpload/list", model: [filesContainer: filesContainer], plugin: 'bootstrap-file-upload').toString()
}

I'm using some sort of trick to detect whether the template is overridden in the application. It's not very clean and it's probably what's causing your problem, but I don't see how to work around it.

@nwittstruck
Copy link
Author

We could add a second Catch clause for IllegalArgumentExceptions as a work around, but I have not found out yet, what's causing the exception.

@saleram1
Copy link

saleram1 commented Aug 2, 2012

@sarbogast I needed to add plugin: 'bootstrap-file-upload' to all render calls in order to get this to work. Tested under Grails 2.0.4 and 2.1 with exact same results.

@greatbalin
Copy link

The same for 2.2.3

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