View Issue Details

IDProjectCategoryView StatusLast Update
0019464mantisbtdb oraclepublic2017-10-04 05:14
ReporterJoAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version1.3.0-beta.1 
Target VersionFixed in Version 
Summary0019464: update user or news info occurs error
Description

error msg for update user
Database query failed. Error received from database was #1407: ORA-01407: cannot update ("MANTIS_TEMP"."MTS_USER"."PROTECTED") to NULL for the query: UPDATE mts_user
SET username=:0, email=:1,
access_level=:2, enabled=:3,
protected=:4, realname=:5
WHERE id=:6.

if checkbox (protected) is checked, update action would work fine.

update news' error msg:
Database query failed. Error received from database was 0001400: ORA-01400: cannot insert NULL into ("MANTIS_TEMP"."MTS_NEWS"."ANNOUNCEMENT") for the query: INSERT INTO mts_news (project_id, poster_id, date_posted, last_modified, view_state, announcement, headline, body) values (:0, :1, :2, :3, :4, :5, :6, :7).

The case is the same.

TagsNo tags attached.

Relationships

related to 0023372 new error updating boolean fields 

Activities

dregad

dregad

2015-03-03 09:19

developer   ~0049129

Last edited: 2015-03-03 09:20

View 2 revisions

Thanks for the report, I'll look into it (as time allows).

What version of Mantis is this on ?
Also, since you reported not being able to install the DB (0019463), can you please explain how you setup your system ?

Jo

Jo

2015-03-03 09:25

reporter   ~0049130

Last edited: 2015-03-03 10:51

View 2 revisions

mantis version: 1.3.0-beta.1

I added an note in the issue (0019463:0049128)

EDIT: you can link to bugnotes using the '~' symbol and the bugnote id.

Jo

Jo

2015-03-04 10:17

reporter   ~0049136

Additional information: checkbox is checked will lead to different results. (insert/update will be fine if checked)

Jo

Jo

2015-03-04 21:00

reporter   ~0049139

Last edited: 2017-10-04 05:14

View 2 revisions

Hi, dregad
please refer this link: http://www.html-form-guide.com/php-form/php-form-checkbox.html

I tried to modify the php file named "manage_user_update.php" .
line 67:

#$f_protected   = gpc_get_bool( 'protected' );
if (isset($_POST["protected"])){
        $f_protected    = gpc_get_bool( 'protected' );
}else{
        $f_protected    = 0;
}

line 128:

#$c_protected = (bool)$f_protected;
$c_protected = $f_protected;

the user update can be fine if protected checkbox is not checked.

dregad

dregad

2015-03-05 04:29

developer   ~0049140

#$f_protected = gpc_get_bool( 'protected' );

gpc_get_bool() already checks if $_POST is set, and will assign a default of 'false' if not.

#$c_protected = (bool)$f_protected;
$c_protected = $f_protected;

So it seems you're just changing the data type of $c_protected. This leads me to believe that there could be an issue with handling of booleans for the oci8 driver.

In any case, even though it might work around your issue for now, I don't think the proposed change is the proper, permanent fix for it. I need to check in more detail, but I don't have access to an Oracle environment at the moment.

In the meanwhile, it would be helpful if you could report here what the actual value of $f_protected is, right after line 67 (including data type, e.g. via var_dump) for both check/unchecked states and with unmodified MantisBT code.

Jo

Jo

2015-03-05 06:08

reporter   ~0049141

log $f_protected while unchecked, the result is null.
by the way, I have tried gpc_get_bool('protected',false), and the result is null, too.

Jo

Jo

2015-03-05 06:09

reporter   ~0049142

oci8 version is 2.0.8

dregad

dregad

2015-03-05 06:39

developer   ~0049143

log $f_protected while unchecked, the result is null.

How can this be ? gpc_get_bool() NEVER returns 'null'... Are you sure you're using an unmodified version of gpc_api.php ?

Jo

Jo

2015-03-05 06:45

reporter   ~0049144

I need to explain the null value is "nothing", not really return 'null' character.
I'm sure that return value is null.
I'll log some information in gpc_api.php, and share to you. (maybe tomorrow..)

Issue History

Date Modified Username Field Change
2015-03-03 05:50 Jo New Issue
2015-03-03 09:19 dregad Status new => feedback
2015-03-03 09:19 dregad Note Added: 0049129
2015-03-03 09:20 dregad Note Edited: 0049129 View Revisions
2015-03-03 09:25 Jo Note Added: 0049130
2015-03-03 09:25 Jo Status feedback => new
2015-03-03 10:50 dregad Product Version => 1.3.0-beta.1
2015-03-03 10:51 dregad Note Edited: 0049130 View Revisions
2015-03-04 10:17 Jo Note Added: 0049136
2015-03-04 21:00 Jo Note Added: 0049139
2015-03-05 03:11 dregad Note View State: 0049139: public
2015-03-05 04:29 dregad Status new => feedback
2015-03-05 04:29 dregad Note Added: 0049140
2015-03-05 06:08 Jo Note Added: 0049141
2015-03-05 06:08 Jo Status feedback => new
2015-03-05 06:09 Jo Note Added: 0049142
2015-03-05 06:39 dregad Note Added: 0049143
2015-03-05 06:45 Jo Note Added: 0049144
2017-09-30 19:24 cproensa Relationship added related to 0023372
2017-10-04 05:14 dregad Note Edited: 0049139 View Revisions