https://bugzilla.wikimedia.org/show_bug.cgi?id=32165

Van de Bugger <van.de.bug...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #9354|0                           |1
        is obsolete|                            |

--- Comment #13 from Van de Bugger <van.de.bug...@gmail.com> 2011-11-04 
19:40:56 UTC ---
Created attachment 9365
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=9365
Attempt #3

`Creation date' is disabled by default and can be enabled by 

$smwgSpecialProperties = array( 'Creation date' );

It is far from being ideal. Problems:

1. Fragile. If user makes a typo, e. g. 

    $smwgSpecialProperties = array( 'Craetion date' );

Special property will now work but user will not see no warnings/errors.

2. There are many "mandatory" special properties enabled by default, like
Allows value, Has type, etc. These special options are not affected by
$smwgSpecialProperties. Should we name it $smwgExtraSpecialProperties?

3. There are some redundancy:

    if ( in_array( 'Creation date', $smwgSpecialProperties ) ) {
        $pcdat = new SMWDIProperty( '_CDAT' );

Relation between 'Creation date' and '_CDAT' is hard-coded here, but this
relationship already coded in SMWLanguage. However, SMWLanguage does not
provide convenient way to map 'Creation date' to '_CDAT'.

Any thoughts how to improve it?

What about adding

    define( 'SMW_CreationDate', '_CDAT' );

so user can write 

    $smwgSpecialProperties = array( SMW_CreationDate );

and we can write 

    if ( in_array( SMW_CreationDate, $smwgSpecialProperties ) ) {
        $pcdat = new SMWDIProperty( SMW_CreationDate );

?

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to