|
From: Hal F. \(D. Inc.\) <ha...@di...> - 2002-08-10 13:47:09
|
Chris, Thank you for the reply, overall OpenInteract/SPOPS are excellent pieces of software. I have not had any problems since I made the change mentioned in the bug report. I am sorry I did not make it more clear... there was no problem editing objects... the problem was in creating objects (any objects, not just theme objects... the theme object was simple the example I provided). The problem comes because the <input type="hidden" name="theme_id" value=""> when creating a new object is not undef, but an empty string as returned by $apr->param( 'theme_id' );. Thus the change from testing for a non-zero vale to testing for a defined value, causes SPOPS::DBI::fetch to attempt to fetch an object when passed the empty string as an id (instead of returning undef). I understand the that rationale behind the change might have been to allow the id '0' (or an empty string for that matter) to be used, which is fine, however the current OpenInteract base_* packages depend on the fact the passing an empty string to the fetch function will return undef allowing them to create a new object. I was testing this using OI 1.40 (and MS IE, if that makes any difference). Hal Finkel Bugs item #572661, was opened at 2002-06-23 00:29 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116810&aid=572661&group_id =16810 Category: None Group: None >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Hal Finkel (half26d) Assigned to: Nobody/Anonymous (nobody) Summary: Bug in SPOPS 0.61 Initial Comment: in SPOPS::DBI::fetch the line: return undef unless ( defined( $id ) and $id !~ /^tmp/ ); causes OpenInteract to fail to create new objects... replacing the line with the older version of: return undef unless ( $id and $id !~ /^tmp/ ); fixes the problem. As an example, attempting to add a new theme object results in an update of the existing 'main' theme (where XXXX is the website name): XXXX::Handler::Theme::edit (95) >> Trying to modify ID <<>> SPOPS::DBI::fetch (253) >> SELECTing: theme_id//title//description//parent//credit SPOPS::DBI::id_clause (141) >> No ID passed in and called as a class method rather than an object method. SPOPS::SQLInterface::db_select (90) >> No SQL passed in to execute directly; building. SPOPS::SQLInterface::db_select (111) >> SQL for select: SELECT theme_id, title, description, parent, credit FROM theme SPOPS::SQLInterface::db_select (123) >> Values bound: SPOPS::SQLInterface::db_select (142) >> Returning single row. SPOPS::DBI::_fetch_assign_row (466) >> Setting data from row into XXXX::Theme SPOPS::DBI::_fetch_assign_row (469) >> theme_id --> 1 SPOPS::DBI::_fetch_assign_row (469) >> title -- > main SPOPS::DBI::_fetch_assign_row (469) >> description --> Your basic SPOPS::DBI::_fetch_assign_row (469) >> parent --> 0 SPOPS::DBI::_fetch_assign_row (469) >> credit --> OpenIntera SPOPS::DBI::_fetch_post_process (503) >> XXXX::Theme ( 1 ) : cache set (if available), post_fetch_action() done, change flag cleared and save flag set. Security: 8 OpenInteract::SPOPS::log_action_enter (135) >> Log [update] to [XXXX::Theme] [1] by [1] on [2002-06-23 02:38:35] Hal Finkel ha...@di... ---------------------------------------------------------------------- >Comment By: Chris Winters (lachoy) Date: 2002-08-09 23:36 Message: Logged In: YES user_id=37377 This is a separate problem, not in SPOPS. This is evidenced by the line: "XXXX::Handler::Theme::edit (95) >> Trying to modify ID <<>>". There's some error with the class getting the ID of the theme it's supposed to edit. What is the theme_id in the database table? Is the theme_id getting set properly in the form? Please email the openinteract-help mailing list if this is still an issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116810&aid=572661&group_id =16810 |