datagrid "Sorry an error occurred" when adding a new column - datagrid

I have a datagrid that is working but when I add another simple column, I the the "Sorry an error occurred" error message. I've tried it for a couple of fields I have on the view and even reverted it back to what I had before. It's still giving me this error. I'd include code but I don't know what to include. Does anyone know this issue?

Related

Drupal 7: Views giving 500 error - stdClass::can_expose is undefined?

I have a view that I have created that seems to crash and cause 500 server errors as soon as I use conditional filters with it.
The error that my server logs are giving me is:
*mod_fcgid:stderr: PHP Fatal error: Call to undefined method stdClass::can_expose() in /sites/all/modules/contrib/views/views.module on line 1971*
So I did a grep for the can_expose function and see it fine in /sites/all/modules/contrib/views/includes/handlers.inc
I'm more convinced that its something that I might be doing wrong in my setup of the view - but I can't be sure (I'm a noob). This only seems to appear on this view that uses conditionals (and I have tried changing them numerous times to different things, seeing if that will change).
If I don't use conditional filters though - the view works fine.
Any ideas?
Thanks
Ryan
Just for kicks, I recreated the view and it works fine. My thought is that something in the original view got corrupt somehow.
Workaround is in place, however - if anyone else has seen this issue, I would love to understand why this error happens

Drupal site webpages getting 500 in google

I am working on a site that is having issues when google tries to crawl over it. (I just inherited this site.) Google is returning a 500 error that it can not find the page. I have done some debug but I am stumped on what more to do.
Here is what I know:
When google crawls the site it gets a 500 from some pages. All the pages with the error seem to be "~/content/~" pages.
When I try to manual fetch the page I also get the 500 error message.
The issue only happens sometimes.
Viewing the webpage in a browser gives no indication that anything is wrong.
This is the error message from my error log.
[17-Jul-2013 21:29:58] PHP Parse error: syntax error, unexpected $end in
/home/~/public_html/sites/all/modules/ctools/plugins/access/php.inc(55) : eval()'d code on line 1
Sometime it says line 1 or line 2.
If I comment out the line below, the error goes away. I don't know what the function below does and if getting rid of it does any harm.
// Provide a summary description based upon the checked roles.
function ctools_php_ctools_access_summary($conf, $contexts)
{
return !empty($conf['description']) ? check_plain($conf['description']) : t('No description');
}
I spoke with the hosting company and they said everything is "OK" on their end.
I submitted a question to the google forums and all the tools that they had me run against the site seemed to return successful information.
The problem seems like its getting progressively worse over time.
The apache log does not have any error messages in it.
From the durpal Admin panel - Node template. When I select contexts for the column variant sometimes I get the WSOD.
I don't see any php code anywhere that could be causing an error.
Does anyone have any ideas what could be going on?
PHP Parse error: syntax error, unexpected $end.... if it's the case
means that PHP has finished analyzing your code, but you forgot to close a symbol somewhere in your page or in those that are included.
Check:
you may forgot to close a quote, so PHP continues to analyze your code until it finds the closing quotation-mark.
You may forgot to close a bracket, so from the last opening, PHP thinks all the code that follows as part of a block that never ends.
You may forgot to close a parenthesis, so from the last open parenthesis, it thinks all the code that follows as part of it and that is not ending.
You may forgot a comma

Invalid field/related field combination

I'm trying to make an entity like vendor in ax 2012. When I click the "new" button I get following error;
Invalid field/related field combination.
I have looked for it on search engines and found out that it might be due to wrong joins used in data sources of the form. I have gone through the joins and links, they all are fine but I'm still getting the same error.
Any one, any idea?
Put a breakpoint in the info.add method to catch AX in the deed.

ASP.Net Dropdown List is not throwing an error

I am having problems with dropdown lists NOT throwing an error with the following code in ASP.Net 4.0
the dropdown list is empty to start. The page in question is a simple test page containing no code besides the lines below in Page_Load.
ddlTest.Items.Add(new ListItem("test","test"));
ddlTest.SelectedValue = "Fail";
When I load the page, the DDL displays "test" as the only item (as expected) and no error is thrown. I thought an error would be thrown with something like "item 'Fail' does not exist"
I have tested the code both, inside an if (!IsPostBack) block and outside of it. The results are the same.
Does this make sense? I don't understand why this is not throwing an error. Any explanation would be greatly appreciated.
Thanks.
It will only throw an exception if there are no items in ddlTest, otherwise it just doesn't find the value.
You can always do this first if you are trying to find out if the item exists in the list:
if (ddlTest.Items.FindByValue("Fail") != null)
ddlTest.SelectedValue = "Fail";
else
//item doesn't exist, do something meaningful here

"Failed to enable constraints" Error keeps cropping up (seemingly randomly) in my ASP.Net project

I have a weird problem where the "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints." error sometimes pops up when I am trying to build my project.
The line in question throwing the error was auto-generated code in the designer file for the dataset. To find out the offending table, I used the following code:
Try
Me.Adapter.Fill(dataTable) <--Breakpoint here on the offending line
Catch ex As Exception
For Each TRow As DataRow In dataTable.Rows
If TRow.HasErrors Then
Trace.Write(TRow.RowError)
End If
Next
End Try
Funnily enough, as soon as I run the project after putting in the above code and breakpoint, the error disappears. I assume this has something to do with the code being regenerated. All data is presented successfully, and the project compiles without errors.
However, this has happened often enough for me to frustrate me. Anybody know what might be causing the error and how I can isolate it?
What unique constraint are you placing on the datatable and have you verified that the data your passing in doesn't have any duplicates? If this is coming from a shared database perhaps someone else is modifying the data which could be causing the randomness.
Edit
If that code is exactly as what you have (And forgive me my vb.net is not as strong as my C#). Wouldn't it swallow the exception? In C# we need to rethrow the error.
Add a Trace.Write() right before you go into your for loop.
You are probably working with a typed dataset, or have some code configuration on it. Also you might be reading from one table, and then adding data from another.
In any of those cases, you really want to look into any inconsistencies between the schema. If it is a typed dataset / or configured in code, check its definition, and look for anything different from the sql table. If you are reading from 2 different tables, check the definition of both tables.
Figured it out finally!
The reason the breakpoint wasn't being hit was because the code in question was auto-generated, and had the attribute "DebuggerNonUserCodeAttribute". In addition, in my VS settings, I had set the debugger to "Just my code".
When I ran the code again, and the breakpoint wasn't hit, I noticed the breakpoint icon had changed to a warning. Hovering showed this:
"The breakpoint will currently not be hit. Breakpoints cannot be set in a method or class with the 'DebuggerNonUserCode' attribute when the debugger option 'Just My Code' is enabled."
Ouch!
Once I had removed the "Just My Code" debugging option, the breakpoint was hit, and I discovered that one of the rows had a NULL value in one of the columns which had a non-null constraint. Stupid ole' me!
You should use this code before you fill DataTable :
var dt = new System.DataTable.DataTable();
dt.Clear();
dt.Rows.Clear();
dt.Columns.Clear();

Resources