Crash when triggering the edit

Reported by MupKoo on 2011-09-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chive
Fix Released
Medium
David Roth

Bug Description

Ok there is a really strange problem and I will try to explain it

The bug occurs when I am browsing some table (for instance stations) and I want to view some entry in other table (for instance users) and I go to the SQL tab and I write my query ( "SELECT * FROM users WHERE name = 'Mirko' "). Everything is fine, the result is ok and I see the entry. But if I try to edit it, I get an error that there is no 'uid' (UserID) in the table.

<h1>Internal Server Error</h1>
<h2>Table &quot;stations&quot; does not have a column named &quot;uid&quot;.</h2>

I think the reason for the problem is that the table in the URI is still stations

Excuse me for my poor English skills :)

Related branches

David Roth (davrot) wrote :

Just tried to reproduce this, but it works for me (both when editing a row and editing a column).

Changed in chive:
status: New → Incomplete
MupKoo (mupkoo) wrote :

I will check the version of Chive tomorrow at work, but I think it is the latest one.

And like I said, the problem comes from the fact that there is no UID column in the table that I come from.

Would you like me to make a video?

MupKoo (mupkoo) wrote :

Ok, the version I have installed is 0.5.1

I tried it with different tables, but I still get the same problem.
It tries to look the PRIMARY KEY in the old table (the table in the URI) and there is no such column in that table. For instance table 'analog' has 'pid', but 'station' has not!

<h2>Table "station" does not have a column named "pid".</h2>

David Roth (davrot) wrote :

I can reproduce this problem when I use the search page and then select from an other table.
When I use the browse page it works for me. Can you confirm this - so are you using the search-form for your where condition?

MupKoo (mupkoo) wrote :

Like I said, excuse me and my English skills :)

I will try to explain again.

1. I am browsing 'firsttable' table (for example)
2. I click on the SQL tab button
3. I write my SQL statement ( 'SELECT * FROM 'secondtable' WHERE secondtableid = 1')
4. Then I see the result as it should be, just one row. The exact row that I want from 'secondtable', but the URI is still http://localhost/chive/schema/databasename#tables/firsttable/sql
5. Then I try to edit the row and I get the error

Firsttable has does not have column named 'secondtableid'

I will try to look it up, but haven't used Yii, so.. :)

David Roth (davrot) wrote :

Ok, search-tab and sql-tab both lead to the error. When I first tried this first, I entered the query in the browse-tab, an there it worked ;)

Anyway, the problem is fixed now in trunk.

Thanks for your report!

Changed in chive:
assignee: nobody → David Roth (davrot)
importance: Undecided → Medium
milestone: none → 1.0
status: Incomplete → Fix Committed
David Roth (davrot) on 2011-12-09
Changed in chive:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers