#135 vcard error: amonth_num not found

v1.0_(example)
closed
nobody
None
1
2012-10-16
2012-10-04
zwerver
No

When generating a Vcard(s) the monthnumber (amonth_num) is not found which generates a warning and thus breaks the generation of a correct Vcard file.

Discussion

  • zwerver
    zwerver
    2012-10-04

    The problem is that the SQL query created for finding the month number works with a join to include the month_lookup table. That table doesn't know the "amonth_num" column. Besides that, if you try to join that table twice you'll naturally get a column name conflict.

    I found a sollution which is probably not the most beautiful SQL but works. In file dbconnect.php

    change:
    $month_from_where = "$base_from LEFT OUTER JOIN $month_lookup ON $table.bmonth = $month_lookup.bmonth WHERE $base_where ";

    to:
    $month_from_where = "$base_from"
    . " LEFT OUTER JOIN $month_lookup AS b_lookup ON $table.bmonth = b_lookup.bmonth"
    . " LEFT OUTER JOIN"
    . " (SELECT bmonth AS amonth, bmonth_short AS amonth_short, bmonth_num AS amonth_num FROM $month_lookup) AS a_lookup"
    . " ON $table.amonth = a_lookup.amonth"
    . " WHERE $base_where ";

     
    Last edit: zwerver 2012-10-04
    Attachments

  • Anonymous
    2012-10-08

    patch for revision 536

     
    Attachments
  • zwerver
    zwerver
    2012-10-08

    patch for revision 536

     
    Attachments

  • Anonymous
    2012-10-08

    Hi, thanks for all the input. I'm setting up an GitHub repository. So branching, patching etc. will be much easier soon.

     
  • chatelao
    chatelao
    2012-10-16

    • status: open --> closed
     


Anonymous


Cancel   Add attachments