DNNCommunity / DNN.Reports

DNN Reports module provides a simple, flexible, view on your database, any table, any view and display results with plugin visualizers
MIT License
21 stars 25 forks source link

Spurious errors #1

Closed DylanTusler closed 6 years ago

DylanTusler commented 8 years ago

I've seen forum posts back to 2006 complaining about errors in the event log regarding this module. They don't stop the module functioning, but they sure make site admin a burden.

I presently get: There is an error in your SQL at line 3: Must declare the scalar variable "@UserID".

Because I'm using @UserID in my query. I've never seen a solution other than "use a different module." Is there another way to suppress these messages?

sleupold commented 8 years ago

most likely, the issue is caused by a scheduled job, e.g. search indexer trying to query the module for data. For technical reasons, the scheduler has no portal context and no userID. Reports might provide a default value, if the value is not available (e.g. Null)

DylanTusler commented 8 years ago

Yes that's it. Search module creates these errors. I couldn't find a way to disable the search crawler on a specific page so I disabled it site-wide (I never had a search box anyway) and disabled the jobs related to it. No more issues.

sleupold commented 8 years ago

In Module Settings (1st tab) > More Settings there is an Option "Index" you may disable (if not generally disabled in module definitions).

DylanTusler commented 8 years ago

Thanks for the clarification. I'm pretty sure that setting didn't stop the messages for me, but its worth a try. As I've disabled the search crawler entirely I'll defer to somebody else to verify that.

EPTamminga commented 8 years ago

The module has a searchable feature. This is correct IF the report can be run without portal and user context. Then each row of data can end up in the search index. I will see if I can prevent a search index creation if the report cannot be run in the required context due to missing portal and/or user info as a result of report parameters.

sleupold commented 8 years ago

EPT, thank you very much!

EPTamminga commented 6 years ago

You can specify not to index the reports module in the settings of the module (Module Settings. Advanced Settings, Allow Indexing: Off).