Sunday, 2010-08-15

../irclogs/#mantishelp.2010-08-15.log
--- scribe started ---00:00
paulrnuclear_eclipse: up at all?00:04
nuclear_eclipseyo00:04
paulrlo00:04
paulrerm00:04
paulrplugin events00:04
paulrcan we change parameters to one?00:05
nuclear_eclipsewhich event, and what change?00:05
paulrEVENT_LOG00:05
paulrto take 2 parameters not one00:05
nuclear_eclipseis it possible to do this while maintaining backward compatibility for anything already using EVNT_LOG?00:06
* paulr shrugs :)00:06
paulrit's a silly event atm00:07
nuclear_eclipsewell, that's the critical point IMO00:07
paulri'm guessing you didn't code event_log event?00:08
nuclear_eclipsenope, that was a Victor thing00:08
paulrright ok00:09
paulrso00:09
paulrstarting from beginning00:09
paulrlog_event takes (int, string) atm00:09
paulrwhere one of the 'strings' is a var_export from db api00:09
paulrI want to change log_event to take either int, string OR int, array00:10
paulr------00:10
paulrnow thep lugin part00:10
paulratm, the plugin fires an event sending in 1 string00:10
paulrformatted as [<stringfromint>]<string>00:10
paulrbut only does this if the log level is set in the global config00:10
paulrwhich given we don't currently define a 'user defined log range'00:11
paulrI kinda wonder about this event :)00:11
nuclear_eclipsepaulr: write up a bug report, implement what you think is best, attach a patch to it, and then poke me on it and I'll look it over; I'm unfortunately a bit busy atm00:13
nuclear_eclipsegot a big release for a mod project I'm working00:13
paulri'll keep the event as was00:13
paulrk00:13
nuclear_eclipseon00:13
istvanbhi there10:49
istvanbis there any documentation exists for the mantis php functions? I mean like the user_get_email($t_recipient) etc?10:50
istvanbyesterday I have spent a quite reasonable amount of time to write my function, which did exactly the same as the user_get_email :)10:51
paulristvanb: you could try http://www.mantisforge.org/cruisecontrol/buildresults/mantisbt?tab=documentation11:40
paulrprobablyu more specifically http://www.mantisforge.org/cruisecontrol/artifacts/mantisbt/20100802185453/api/elementindex.html11:41
* paulr hopes dhx is coming back11:41
istvanbthanks man11:41
istvanbI will try11:41
istvanbI am working on a mantis plugin11:41
istvanbif I am done, who can revise it?11:42
paulr?11:42
istvanbI guess if I create a plugin somebody has to check it11:44
istvanbis that true?11:44
istvanbI am also wondering if I can get a help for my plugin from a developer. I have no experience in php at all (however have a coding history of 15 years), so this is my first project11:48
paulri'm sure people will answer questions if you get stuck11:53
istvanbok11:56
istvanbI have a question then, maybe you can answer it11:56
paulrtry11:56
istvanbI'd like to create a multiple selection box with all the user groups (admin, reporter, viewer etc)11:56
istvanbI have found the following function:11:56
istvanb<?php print_project_access_levels_option_list (null) ?>;11:57
istvanbthe problem with this: it also adds the [default access level] at the first element11:57
istvanbI dont want this to be there11:57
istvanbdo you know how the exclude this?11:58
paulrprint_project_access_levels_option_list only shows access levels below the person viewing it12:01
paulri didn't realise it added a default12:01
paulrand at least, can't see where it adds default12:01
istvanbok, then let me rephrase12:02
istvanbI need a box displaying the access levels (all of them). I am stuck with the function above, any solution would be fine for me12:02
paulrcould always make your own function using  print_project_access_levels_option_list as a base12:09
paulrfor nwo12:09
istvanbok12:11
istvanbnow I see why it displays the default level12:11
istvanbin the print api definition12:12
istvanbthereis a line echo '<option value="' . DEFAULT_ACCESS_LEVEL . '"';12:12
istvanbif I comment this then the defult level is gone12:12
istvanbhowever I rather somehow eliminate it from my list instead of writing my own function. Would be much better and easier to understand12:13
paulrwhat version are you developing against?12:16
istvanb1.2.0 or above12:16
istvanbhowever my plugin is using only very basic functionalities so probably it would work with previous versions as well12:16
paulrhttp://git.mantisbt.org/?p=mantisbt.git;a=commitdiff;h=101d87befda99950e7df8cabe2af5f1d4b7591be12:17
paulrseems that's changed in trunk :)12:17
istvanbis this for the 1.2.2?12:20
istvanbon my PC I have 1.2.112:20
paulrprobably more 1.3-dev12:24
istvanbyeah12:24
istvanb$t_access_levels_enum_string = config_get( 'access_levels_enum_string' ); $t_enum_values = MantisEnum::getValues( $t_access_levels_enum_string ); foreach ( $t_enum_values as $t_enum_value )  { $t_access_level = get_enum_element( 'access_levels', $t_enum_value ); echo '<option value="' . $t_enum_value . '"'; check_selected( $p_val, $t_enum_value ); echo '>' . $t_access_level . '</option>'; }12:29
istvanbok12:29
istvanbI have copied the stuff from the print api12:29
istvanband deleted some lines12:29
istvanbit seems to be working for me12:29
istvanbits quite difficult to code something if you dont know the language:)12:30
istvanbis there any specific php development tool, which has the feature to display the function definition easily?12:31
istvanbbecause now I always have to search the files to find the funtion definition12:32
paulrnot sure12:34
paulrI tend to know mantis' code fairly well12:34
paulrso know where to look12:34
istvanb:)12:35
istvanbeasy for you then :)12:36
istvanbok, next question12:40
istvanbhow can I add my pluginpage to the menu bar at the top (where the my view etc tabs are)12:41
paulrpretty sure there's an event12:52
istvanbnext question12:54
istvanbI am on the config page12:54
istvanband the button redirect me to the config_edit.php12:54
istvanbwith the gpc command I can get the content of a specific field from the config.php12:55
istvanbgpc_get_int( 'sajat_blabla_threshold', ADMINISTRATOR );12:55
istvanbwhat the ADMINISTRATOR means here?12:55
paulriirc, default value12:57
istvanbiirc? whats that?12:57
paulrif I recall12:57
istvanboh :)12:58
istvanbnow12:58
istvanblets say I set a value to reporter than press the button12:58
istvanbhopefully it sets the variable to reporter, and then redirects me to the config.php12:59
istvanbthe enum shows Admin again12:59
istvanbis this expected, or it should show reporter and I made a mistake?12:59
istvanbits a mistake13:00
paulrcheck_selected( $p_val, $t_enum_value )13:00
paulrdepends what you pass in as $p_val13:00
paulror load in or whatever13:00
istvanbwhen I do the same with the tasks plugin13:00
istvanbit shows what I have set13:00
istvanbgeez its not easy to start coding in php :)13:01
istvanbok, now I have it13:02
istvanbthis is resolved13:02
istvanbI have queried back something else, thats why it displayed admin all the time13:02
istvanbso now I have a config.php and a config_edit.php which should work fine13:05
istvanbI also have the page which realizes the function I'd like to achive13:05
istvanbso somehow depending on the access level I have to make the function page accessible for the users13:06
istvanbdo you have a clue how to do this?13:06
istvanbok... its enough from geeky stuff for today :)13:20
istvanbmaybe I will continoue later:)13:20
istvanbtake care all!13:20
paulrlo dhx_m15:42
paulrgone to bed yet?15:42
* paulr pokes nuclear_eclipse17:14
paulrsiebrand: lo?19:16
paulrwow21:58
paulrthis code is like21:58
paulrspaghetti21:59
Renegade15good evening22:03
paulrdo you like  spaghetti?22:05
Renegade15as a god or as food?22:06
paulrin php :)22:06
Renegade15I would rather prefer straight-forward code, if that's the question.22:07
* paulr waits patiently for dhx :)22:08
Renegade15I'm having a weird issue with plugin_lang_get(): I have a MantisColumn-derived class in a second file, and I'm trying to get a language string in there. In the primary file, plugin_lang_get('string name', 'plugin name') works fine - in the second file, the exact same (copy-pasted) code gives me an Application Error 300, claiming the string doesn't exist22:08
Renegade15what's confusing me is that the error includes the manufactured string name, so obviously it did call the function and tried to get the string - so it shouldn't be a scope issue o_O22:09
Renegade15the only thing that stands out to me is that the string name in the error doesn't include the s_ prefix, but as said - the exact same code works in the primary file22:10
Renegade15does anyone have any idea what could be going wrong?22:10
paulrthat's a nuclear_eclipse type of question22:11
paulrheh22:11
Renegade15I figured22:11
* Renegade15 pokes nuclear_eclipse 22:11
Renegade15so while I'm waiting for the God of Plugins...what's this about spaghetti?22:15
Renegade15is mantis being invaded by goto?22:15
* micahg sighs...goto22:18
paulrwell,22:24
micahgtry{assert(!defined(NOSTALGIC_FOR_BASIC));}catch exception(){goto 1975;} :)22:24
paulrwhen a helper function calls a custom function that calls22:24
paulr:)22:24
Renegade15reminds me of the notification e-mail code I was looking at yesterday22:26
Renegade15speaking of which, I have another, unrelated weird issue22:26
paulrcustom functions need to die22:26
paulr:)22:26
paulrmantis is great - you can configure everything :)22:26
paulrbut that's also a downside22:27
paulras whenever someone asks something22:27
paulrwithout looking yourself22:27
nuclear_eclipseRenegade15: are you sure the lang string is defined correctly for your plugin?  ie it should be defined as $s_plugin_PLUGINNAME_some_string = ...22:27
paulryou've got no chance :)22:27
Renegade15notification e-mails pertaining to bug updates and stuff show a normal url to the bug; notification e-mails about bug notes apparently show the absolute server path instead. I believe the dev reporting the problem implied it happened for notes added by the source code integration user account. Any ideas what could cause that?22:27
Renegade15nuclear_eclipse: As said in the description, I tried the exact same code in the primary file and it worked as expected22:28
Renegade15so yes, I'm sure22:28
paulrnuclear_eclipse: I think i've managed to sync the stuff I did in february :)22:28
nuclear_eclipseI have no other idea, I've never had that problem22:28
paulr(almost)!22:28
Renegade15weird22:30
nuclear_eclipseRenegade15: my only other suggestion is to post the code, and I can take some time to look it over and see if I can find the problem (not tonight though)22:30
paulrnuclear_eclipse: check i've not broken anything today too ;p22:31
* nuclear_eclipse is afraid to look22:31
paulrwell, I did the lang_api change22:32
paulrwhich dhx/(maybe you) reviewed before22:32
CIA-103Mantisbt: paul * rd4c9fb68cbde /core/lang_api.php: Update lang api for new language files22:32
paulrand changed logging a bit22:32
CIA-103Mantisbt: paul * r272bde39d6e0 /bug_view_inc.php: compress_api.php is included by core.php22:32
CIA-103Mantisbt: paul * rcad0ad10f410 /lang/ (50 files): Convert language files to array format22:32
CIA-103Mantisbt: paul * r3ea2997ae1b2 / (12 files in 7 dirs): Diagnostic Logging22:32
CIA-103Mantisbt: paul * rf15d1bfa8139 /core/custom_function_api.php: Arguments for config_get are incorrect - order should be user,project22:32
CIA-103Mantisbt: paul * r8b4f607488f2 /core/helper_api.php: This block of code, is currently pointless:22:32
nuclear_eclipsepaulr: one question, does your lang_api change break the way plugins currently work?22:32
paulrI dont think so22:32
Renegade15on principle, sure, though there's really not much to look at - it works in one file, and doesn't work in the other. The only difference is that it's not directly in the class declaration (only via required_once), but that's what I'm passing the base name for; the same approach is working fine for plugin_table22:32
paulrit's backwards compatible22:33
paulri.e.22:33
paulrstring / array formats22:33
paulri've had german strings + english array22:33
paulrenglish strings + german array22:33
nuclear_eclipseok22:33
paulrand it's shown language i'd expect i.e. german/english22:33
paulri've also tested all language files22:33
paulrto be fair, I've not tested plugin's specifically today22:33
nuclear_eclipsepaulr: would be greatly appreciated if you did taht22:34
paulrneed to know if I need to add @author's tags back into the converted files or whether CREDITS is still up to date22:34
paulrI still get german/english plugins for graphs22:35
paulrthe logging change was to try to start to tidy up22:36
paulrand maybe be a bit more useful22:36
* paulr would kinda like to simplify some of the config *a bit*22:37
paulralbeit, we ofc need all the thresholds etc22:37
paulrif i've broken something22:37
paulremail me paul@mantisforge.org22:37
paulrand it appears in my IM client now22:37
Renegade15okay22:54
* Renegade15 pokes nuclear_eclipse 22:55
Renegade15I got it to work22:57
Renegade15but the how is not exactly clearing things up for me22:57
Renegade15I simply added a single line $foo = plugin_lang_get('option_desc_prefix', 'TripleI'); before requiring the second file, and that magically made all strings load properly22:59
Renegade15is it possible plugin strings aren't loaded until a load request comes from inside the plugin class or something?22:59
paulr# This function prints the custom buttons on the current view page based on specified bug id23:02
paulr# and the context.  The printing of the buttons will typically call html_button() from23:02
paulr# html_api.php.  For each button, this function needs to generate the enclosing '<td>' and '</td>'.23:02
paulrfunction custom_function_default_print_bug_view_page_custom_buttons( $p_bug_id ) {23:02
* paulr ponders23:02
nuclear_eclipseRenegade15: hmm23:03
Renegade15just checked, it also works without the base name parameter within the plugin class...so basically, as long as there's at least one language request beforehand in the primary file/plugin class, it works fine externally23:03
Renegade15looks to me like "external" calls simply don't trigger loading23:03

Generated by irclog2html.py