MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006626mantisbtcustom fieldspublic2006-01-23 07:412013-08-26 06:03
ReporterLeonard 
Assigned Todaryn 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.0.0rc5 
Target Version1.3.xFixed in Version1.3.x 
Summary0006626: Support "Memo" custom field type
DescriptionI added a new custom field type memo. The data is stored in a text field in the database. The patch requires a new table mantis_custom_field_text_table with the following structure:
CREATE TABLE `mantis_custom_field_text_table` (
  `field_id` int(11) NOT NULL default '0',
  `bug_id` int(11) NOT NULL default '0',
  `value` text collate latin1_general_ci,
  PRIMARY KEY (`field_id`,`bug_id`),
  KEY `idx_custom_field_bug` (`bug_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
Additional InformationThe patch is created for version 1.0.0rc5.
Tagspatch
Attached Fileszip file icon mantis-1.0.0rc5_patch.zip [^] (84,005 bytes) 2006-01-23 07:41
zip file icon mantis-1.0.0.rc5_patch_custom_field_api.zip [^] (2,020 bytes) 2006-01-26 09:42
zip file icon mantisbt issue 6626 - 1_2_0a1.zip [^] (4,616 bytes) 2008-06-01 16:14
diff file icon memo_cf_1d43887af615582304a66d6eca0c9a6cb613e5b5.diff [^] (16,166 bytes) 2008-12-02 16:20 [Show Content]
patch file icon custom_field_api_1.1.6.php.patch [^] (316 bytes) 2009-11-02 03:28 [Show Content]
patch file icon mantis-1.2.3-patch-textarea.patch [^] (11,009 bytes) 2010-10-22 04:33 [Show Content]
patch file icon mantis-1.2.4-patch-textarea.patch [^] (10,769 bytes) 2010-12-16 03:53 [Show Content]
patch file icon mantis-1.2.5-textarea.patch [^] (11,316 bytes) 2011-07-18 21:58 [Show Content]
? file icon manage_custom_field_edit_page.php [^] (10,705 bytes) 2013-08-25 21:43 [Show Content]

- Relationships
has duplicate 0009066closedvboctor Require custom field type: “Text” 
has duplicate 0005000closedvboctor String custom field type isnt big enough - need multiline string option 
has duplicate 0004705closedvboctor Add Text type in addition to String for custom field types 
has duplicate 0005967closedvboctor Textarea-Fields 
has duplicate 0005679closedvboctor Make long string custom fields use textarea instead of input 
has duplicate 0005493closedvboctor Multiline Custom Fields 
has duplicate 0004373closedvboctor Multi-line custom field type 
has duplicate 0011097closedvboctor Offer Custom Fields (String) with maxLength > 255 characters and displayed as TEXTAREA 
has duplicate 0011863closeddaryn Custom Field as TextArea 
has duplicate 0012464closedatrol Custom Field with a TEXT AREA 
has duplicate 0013688closedatrol build some custom field item ,how to build custom item is a big window 
has duplicate 0014027closedatrol Build a new Custom Fields(Type is string) ,word space issue 
related to 0010923closedvboctor function history_log_event_direct should check (and eventually truncate) the length of the new and the old value 
related to 0014817closeddregad New column "text" in mantis_custom_field_string_table cause some custom field data missing from display 
related to 0015681closedatrol [customer fields]: How to make the fileld to multi-rows? 

-  Notes
User avatar (0012018)
Leonard (reporter)
2006-01-25 06:22

There is a failure in the custom_field_api.php in function custom_field_distinct_values in the first version of the patch, sorry for this. Please use this one.
User avatar (0012849)
cjallais (reporter)
2006-05-16 12:02

Missing this line in config_default_inc.php (add it just after line 1224):

$g_mantis_custom_field_text_table = '%db_table_prefix%_custom_field_text%db_table_suffix%';
User avatar (0017876)
vboctor (administrator)
2008-05-20 02:32

Leonard, it would be great if you can upload an updated patch. It would also be very useful in adding a note that describes the functionality that you support for memo custom fields.

For example:
1. Filtering - probably shouldn't be supported.
2. Support as columns - View Issues, Print Issues, Word Export, Excel Export, CSV export.
3. What happens when a custom field type is changed from a string to a memo? Is this supported?
4. How do you determine the size of the text area?
5. Does the update custom field page still use a single line edit box for default value?
6. What about fields like possible values? I assume they don't apply to memo custom fields.
User avatar (0017984)
Leonard (reporter)
2008-06-01 16:29

I couldn't find the old patch. So i used the weekend to rewrite the custom field text support for the current svn head. I uploaded the patch as a zip archive. Now some words to your questions.
1. I think i would be fine if i can use the search string for custom text fields, but until now it doesn't work.
2. This should be ok.
3. If you change from string to memo and back the data is lost. I think i should extend the functions to copy the data from one table to the other.
4. The text areas are 80 cols and 10 lines like the other text areas description and additional information.
5. Yes, this is a single line edit box.
6. I set the values in cfdef_standard.php to false. Is it enough?

I'm very interested in some feedback to finalize the implementation for using in mantis.
User avatar (0018538)
vboctor (administrator)
2008-07-15 04:16

I haven't reviewed the patch yet, but we should do that and get support for memo fields added to Mantis.
User avatar (0020201)
mthibeault (reporter)
2008-12-02 16:25

I updated the code to be used on GIT commit 1d43887af615582304a66d6eca0c9a6cb613e5b5. The only "new" things are:
1) I modified some of the custom field to use db_query_bound instead of db_query.
2) Some code that modifies the custom field in bug view got in the patch. That code pushes three custom fields per line instead of only one. Helps get some space back (anyway, it is possible to get away from that behavior just reverting bug_view* files).

Sadly, I haven't had much time to test everything, hope it still helps.
User avatar (0023109)
Baerlon (reporter)
2009-10-09 10:24

I would prefer to get a multiline input without any restrictions.

Is the issue 0004373 a duplicate?
User avatar (0023536)
liebscher (reporter)
2009-11-02 03:29

Added patch custom_field_api_1.1.6.php.patch for functionality described in 0011097.
User avatar (0027117)
jmonin (reporter)
2010-10-22 04:35

I've backported the 1.3.x commit for Mantis 1.2.3; it also includes the French translation.
As for the database update, I ran the command: "ALTER TABLE `mantis_custom_field_string_table` ADD `text` LONGTEXT NULL DEFAULT NULL"
Btw, the original repo commit uses a "XL" type and I really couldn't figure what it was... Is my assumption about the LONGTEXT correspondence correct?
User avatar (0027615)
jmonin (reporter)
2010-12-16 03:53

You'll find attached my updated patch for Mantis 1.2.4. Hope it helps!
User avatar (0028827)
akit (reporter)
2011-05-24 06:04

After applying the patch for Mantis 1.2.4 and executing the database update above, I get the following warning in the login page:

APPLICATION WARNING #100: Configuration option 'custom_field_string' Not found

The patch seems to be working allright but I get this warning.

Should I add some configuration option in the config_inc.php?
User avatar (0029192)
vboctor (administrator)
2011-07-18 22:04

I've attached an updated patch for Mantis 1.2.5 named 'mantis-1.2.5-textarea.patch'. This patch includes the following changes:

1. Updated to work with 1.2.5.
2. Fixed a bug where changes to the schema file were incorrect (had invalid table name) and caused a warning.
3. Fixed a bug where the custom field validation was broken where it didn't enforce "required" flag on textarea fields.
User avatar (0029302)
mantisaccount (reporter)
2011-07-27 03:16
edited on: 2011-07-27 05:13

I applied the patch "mantis-1.2.5-textarea.patch" to Mantis 1.2.5, and I added the table to the database (copy-pasted the SQL in the description). I added a new custom field of type "textarea".

When I create an issue, I get the following error:

APPLICATION ERROR 401
Database query failed. Error received from database was #1054: Unknown column 'text' in 'field list' for the query: SELECT text
FROM mantis_custom_field_string_table
WHERE field_id=? AND
bug_id=?.

Do I have to apply other patches as well, or should it work when I apply the "mantis-1.2.5-textarea.patch" patch and add the table to the database? Patching went OK btw, no errors or warnings at all...

User avatar (0029307)
vboctor (administrator)
2011-07-27 23:05

@mantisaccount, you need to add the memo field to the table. If you logout, you will notice and have the admin/ folder available, you will notice that there is a schema out of date message. Once the schema is upgraded, your error should go away.

Notice that if you do a schema upgrade, future versions of MantisBT may be confused thinking that you applied schema step N, where N in the next version may be a different upgrade step than the memo field.
User avatar (0029308)
atrol (developer)
2011-07-28 02:27

Reminder sent to: vboctor

Swapping database upgrades 184 and 185 in master and next branch should prevent breaking the upgrade.
If there are more users providing patches for 1.2.x with database schema changes this will not help.
I will get some fun in forum after releasing 1.3.x ...
User avatar (0029309)
mantisaccount (reporter)
2011-07-28 02:35
edited on: 2011-07-28 03:49

Thank you for your quick answer. I won't risk any upgrade problems in the future, so i´ll skip this patch for now. I assume this textarea / memo issue will be implemented in future versions of Mantis, since lots and lots of users are needing this field? B.t.w. great work!!

@atrol: So if I understand correctly I can apply this patch without having problems with the next upgrade (theoretically), if no other schema-changing patches are applied? If so, I'll apply this patch immediately, since we need it asap :)

User avatar (0029310)
atrol (developer)
2011-07-28 04:23

You _will_ get problems the way it is at the moment.
You will not get problems if
a) the current implementation of the 1.3 upgrade will be changed the way I sent to vboctor and
b) there will be no other change in 1.3 that breakes the patch.

a) maybe will be done
b) is gambling because contributors to 1.3 can not take in consideration that their changes might break any unofficial patches
User avatar (0029311)
mantisaccount (reporter)
2011-07-28 04:27

Thank you for your answer. I'll wait until it's officially included in Mantis, I can't afford to get into trouble applying this patch...
User avatar (0029597)
ezraw (reporter)
2011-08-29 17:55

I ran the 1.2.5 patch against 1.2.7 and it worked nicely. Thank you.

 Just posting here in the hopes that vbocter includes the changes noted in http://www.mantisbt.org/bugs/view.php?id=6626#c29310 [^] in 1.3.
User avatar (0029854)
rombert (developer)
2011-09-23 05:20

I'm interested in seeing this included in 1.2.x . Are there any thoughts about the implications of the fixes suggested by @atrol in 0006626:0029308 ?
User avatar (0029864)
rombert (developer)
2011-09-26 08:56

See also https://github.com/mantisbt/mantisbt/pull/15 [^] .
User avatar (0033306)
M.C.S. (reporter)
2012-10-25 04:45

*push* as a whole year passed now, and 1.3 still seems to be far away...
User avatar (0033307)
atrol (developer)
2012-10-25 06:16

M.C.S., maybe you can invest some time resolving the blocking issues for 1.3 0014088
IMO this one is our show stopper at the moment 0014099
User avatar (0033309)
M.C.S. (reporter)
2012-10-25 06:39

Phew, I earn my money with writing Java EE software. With PHP I only had little contact, especially since I have to maintain several MantisBT installations for a business customer. I fear that my understanding of PHP is way too small to be helpful at bigger issues :-(

Please don't get my comments wrong, I understand that things need programmers with time and passion, and that especially time is the rarest part. I am glad that I partly understand how to use Git ;-)
User avatar (0037911)
chakra (reporter)
2013-08-22 02:52
edited on: 2013-08-25 21:42

Hi vboctor,
Thank you very much for the patch.
I have following problem using this patch:

The "Default Value" input field for "Textarea" custom field is still a textbox with max length=255. I guess this should be a textarea without any restriction on size.
------------------------------------------------------------------------------------------------------------
If any one needs above behavior for "Default Value" "Textarea" custom field:
1.* Execute following SQL query :
-----------------------------------------------------------------------------------------------
alter table mantis_custom_field_table change default_value default_value longtext not null;
-----------------------------------------------------------------------------------------------
2. Check the attached manage_custom_field_edit_page.php file & make changes accordingly

User avatar (0037927)
dregad (developer)
2013-08-26 06:03

@chakra
Thanks for the update and fix. However, please note that this feature has been implemented in 1.3 (master) branch, so please provide your patch against the latest git trunk aswewill not back-port this to 1.2. Also, for security reasons we do not allow inline scripts anymore.

- Related Changesets
MantisBT: master 839f1d68
Timestamp: 2010-08-25 19:50:24
Author: daryn
Details ] Diff ]
Fix 0006626 - Add text area custom field type. Add column to handle long
text input. If the custom field type is TEXTAREA values are inserted into
the text field. Otherwise they are inserted into the existing value field.
Filters for TEXTAREA custom fields are not populated with existing data. A
text box is provided and a LIKE query is performed.
mod - lang/strings_english.txt Diff ] File ]
mod - core/cfdefs/cfdef_standard.php Diff ] File ]
mod - core/custom_field_api.php Diff ] File ]
mod - core/filter_api.php Diff ] File ]
mod - admin/schema.php Diff ] File ]
mod - config_defaults_inc.php Diff ] File ]
mod - core/constant_inc.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2006-01-23 07:41 Leonard New Issue
2006-01-23 07:41 Leonard File Added: mantis-1.0.0rc5_patch.zip
2006-01-25 06:22 Leonard Note Added: 0012018
2006-01-26 09:42 Leonard File Added: mantis-1.0.0.rc5_patch_custom_field_api.zip
2006-05-16 12:02 cjallais Note Added: 0012849
2008-05-20 02:20 vboctor Relationship added has duplicate 0009066
2008-05-20 02:32 vboctor Note Added: 0017876
2008-06-01 16:14 Leonard File Added: mantisbt issue 6626 - 1_2_0a1.zip
2008-06-01 16:29 Leonard Note Added: 0017984
2008-07-15 04:13 vboctor Relationship added has duplicate 0005000
2008-07-15 04:14 vboctor Relationship added has duplicate 0004705
2008-07-15 04:16 vboctor Note Added: 0018538
2008-07-15 04:16 vboctor Status new => acknowledged
2008-07-15 04:16 vboctor Summary new custom field type Memo => Support \"Memo\" custom field type
2008-07-15 04:29 vboctor Relationship added has duplicate 0005967
2008-07-15 04:32 vboctor Relationship added has duplicate 0005679
2008-07-15 04:47 vboctor Relationship added has duplicate 0005493
2008-07-15 08:14 grangeway Status acknowledged => assigned
2008-07-15 08:14 grangeway Assigned To => grangeway
2008-12-02 16:20 mthibeault File Added: memo_cf_1d43887af615582304a66d6eca0c9a6cb613e5b5.diff
2008-12-02 16:25 mthibeault Note Added: 0020201
2009-09-19 10:51 dhx Tag Attached: patch
2009-10-09 10:24 Baerlon Note Added: 0023109
2009-10-09 16:02 vboctor Relationship added has duplicate 0004373
2009-10-31 04:35 vboctor Relationship added has duplicate 0011097
2009-11-02 03:28 liebscher File Added: custom_field_api_1.1.6.php.patch
2009-11-02 03:29 liebscher Note Added: 0023536
2010-06-18 10:36 atrol Relationship added related to 0010923
2010-08-25 15:43 daryn Relationship added has duplicate 0011863
2010-08-25 16:10 daryn Changeset attached => MantisBT master 839f1d68
2010-08-25 16:10 daryn Assigned To grangeway => daryn
2010-08-25 16:10 daryn Resolution open => fixed
2010-08-25 16:10 daryn Fixed in Version => 1.3.x
2010-10-20 06:21 atrol Relationship added has duplicate 0012464
2010-10-22 04:33 jmonin File Added: mantis-1.2.3-patch-textarea.patch
2010-10-22 04:35 jmonin Note Added: 0027117
2010-12-16 03:53 jmonin File Added: mantis-1.2.4-patch-textarea.patch
2010-12-16 03:53 jmonin Note Added: 0027615
2011-05-24 06:04 akit Note Added: 0028827
2011-07-18 21:58 vboctor File Added: mantis-1.2.5-textarea.patch
2011-07-18 22:04 vboctor Note Added: 0029192
2011-07-27 03:16 mantisaccount Note Added: 0029302
2011-07-27 05:13 mantisaccount Note Edited: 0029302 View Revisions
2011-07-27 23:05 vboctor Note Added: 0029307
2011-07-28 02:27 atrol Note Added: 0029308
2011-07-28 02:35 mantisaccount Note Added: 0029309
2011-07-28 03:49 mantisaccount Note Edited: 0029309 View Revisions
2011-07-28 04:23 atrol Note Added: 0029310
2011-07-28 04:27 mantisaccount Note Added: 0029311
2011-08-29 17:55 ezraw Note Added: 0029597
2011-09-23 05:20 rombert Note Added: 0029854
2011-09-26 08:56 rombert Note Added: 0029864
2011-12-19 10:54 atrol Relationship added has duplicate 0013688
2012-03-09 06:02 atrol Relationship added has duplicate 0014027
2012-10-25 04:45 M.C.S. Note Added: 0033306
2012-10-25 06:16 atrol Note Added: 0033307
2012-10-25 06:39 M.C.S. Note Added: 0033309
2012-11-30 10:18 dregad Relationship added related to 0014817
2013-03-26 03:31 atrol Relationship added related to 0015681
2013-04-06 09:30 dregad Status assigned => resolved
2013-04-06 09:30 dregad Target Version => 1.3.x
2013-08-22 02:52 chakra Note Added: 0037911
2013-08-22 04:07 chakra Note Edited: 0037911 View Revisions
2013-08-25 21:42 chakra Note Edited: 0037911 View Revisions
2013-08-25 21:43 chakra File Added: manage_custom_field_edit_page.php
2013-08-26 06:03 dregad Note Added: 0037927


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.2334 seconds.
memory usage: 3,445 KB
Powered by Mantis Bugtracker