Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Bugs in 1.1.1 and suggested fixes for 1.2.0  (Read 12242 times)

0 Members and 1 Guest are viewing this topic.

EZ

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 130
Bugs in 1.1.1 and suggested fixes for 1.2.0
« on: October 05, 2003, 04:21:41 pm »

Many thanks to Morrey for salvaging this post from the old board!

(05-Oct-2003: Re-posted on new Coppermine board).
(07-Sep-2003: Added new bugs & solutions #8, #9).
(12-Sep-2003: Changed solution to #7 to be simpler and better.)
(12-Sep-2003: Added enhancement #10.)

Here are some problems that I've found with development version 1.1.1 and how I have solved them.

Summary:
  • Fix missing scrollbars in full-size image view on Mozilla browsers.
  • Fix incorrect charset in full-size image view.
  • Fix image file size so it works also with Right-To-Left language.
  • Fix login redirect with phpBB.
  • Fix logout redirect with phpBB.
  • Cosmetic - in thumbnail view align thumbs in middle of table cells.
  • Fix next/prev arrow images to work also with RTL languages.
  • Fix e-cards for compatability with MS-Outlook.
  • Fix probelm when buttons don't show in IE 5.X with RTL language.
  • Enhancement - Allow admin to change category of user albums.[/list:u]
    BACKUP ANY FILES YOU CHANGE AND DO IT BEFORE YOU CHANGE THEM

    ----------

    1. When viewing big images in full size image with Mozilla, the size and position of the pop-up window isn't correct, and scrollbars are not displayed. The problem doesn't appear with IE.

    Fix for scrollbars: In displayimage.php line#138, add "scrollbars=yes" to the javascript call:
    Code: [Select]
    $pic_html = "<a href=\"javascript:;\" onClick=\"MM_openBrWindow('displayimage.php?pid=$pid&fullsize=1','".uniqid(rand())."','scrollbars=yes,toolbar=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
    However I think that if the window size and positioning problem will be fixed, then Mozilla will also show the scroll bars, so the above fix will not be necessary.

    ----------

    2. In full size view, the HTML is created with incorrect charset in the HTML header <META ...charset=...>. This sometimes causes some garbage to be displayed near the picture.

    Fix in displayimage.php line #336, add global variable:
    Code: [Select]
    global $lang_errors,$lang_charset;
    Fix in displayimage.php line #347, add expression that returns correct charset:
    Code: [Select]
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $CONFIG['charset'&#93; == 'language file' ? $lang_charset &#58; $CONFIG['charset'&#93; ?>" />
    This fix is consistent with HTML generation throughout Coppermine, and has no side effect as far as I can see.

    ----------

    3. Extra space between image size and size units causes inverted display in Right-to-Left languages (eg. Hebrew). For example, when a file size is displayed as "97 KB", in RTL it is inverted as "KB 97", because of the space between the number and the units.

    Fix: In displayimage.php line #228, remove the space in the position marked by xxxx:
    Code: [Select]
    $info[$lang_picinfo['File Size']] = ($CURRENT_PIC_DATA['filesize'] > 10240 ? ($CURRENT_PIC_DATA['filesize'] >> 10)[b]xxxx[/b].$lang_byte_units[1] : $CURRENT_PIC_DATA['filesize'].' '.$lang_byte_units[0]);
    Note that this will also affect the display of image file size for all languages, ie. it will always be displayed like "97KB".

    ----------

    4. When integrated with phpBB, after logIN the user is not redirected back to Coppermine (and goes to phpBB).

    Fix in bridge/phpbb.inc.php line #245 add redirect parameter (change to match the directory where your gallery is installed):
    Code: [Select]
    $target = 'login.php'.'?redirect=/gallery/';
    Tested to work perfectly well with phpBB v2.0.4, when phpBB installed under /htmlroot/forum and Coppermine under /htmlroot/gallery.
    A more elegant solution is to add a config/admin parameter with path to gallery, and use that value instead of hard-coded value.

    ----------

    5. When integrated with phpBB, after logOUT the user is not redirected back to Coppermine (and goes to phpBB). I have 2 different fixes for this, which I will only describe, but not give all the exact code because it's too big.

    First solution: In bridge/phpbb.inc.php line #254 add redirect as above, and change phpBB login.php as follows:
    * Save a copy of the original file.
    * Add the following code between line #43-#45:
    Code: [Select]
    $redirect_var = isset($HTTP_POST_VARS['redirect']) ? $HTTP_POST_VARS['redirect'] : (isset($HTTP_GET_VARS['redirect']) ? $HTTP_GET_VARS['redirect'] : '');* Do a search&replace from $HTTP_POST_VARS['redirect'] to $redirect_var

    The changes to phpBB login.php are required because phpBB does not check for a redirect GET parameter during logout (only during login). Tested ONLY with phpBB 2.0.4 - later versions will probably be different, but if you know PHP you can adapt the solution to other versions.

    Second solution (just an idea, NOT tested) - doesn't require any change to phpBB, but requires more changes to Coppermine. Change the Logout link in Coppermine's main menu to call a new HTML file, for example bridge/phpbbold_logout.html that does contains the following:
    * A form with a hidden field like:
    Code: [Select]
    <input type="hidden" name="redirect" value="/gallery/" />* A submit button that calls phpBB login.php with logout parameter.
    * An onLoad event (on <BODY>), that automatically submits the form.

    This should work because phpBB login.php script checks for a redirect POST parameter during logout (and also during login, so such a solution can also work for login redirect back to Coppermine).

    ----------

    6. A minor cosmetic issue: In thumbnail view, the thumbnails are displayed in table cells aligned to the top. I find it more pleasing to have the thumbnails vertically centered, especially when there are thumbnails with different dimentions on the same row.

    Fix in themes/default/theme.php line #284 & #297, add valign:
    Code: [Select]
    <td valign="center" class="thumbnails" width ="{CELL_WIDTH}" align="center">
    <td valign="center" class="thumbnails" align="center">&</td>


    ----------

    7. For RTL languages, the next/previous arrows in the picture nav-bar should be reversed. For example, with "normal" LTR languages the arrows images show correctly as " < > ", however in RTL they become " > < ".

    Fix in themes/default/theme.php lines:
    * #373 - Replace prev.gif with {PREV_IMAGE}.gif
    * #376 - Replace next.gif with {NEXT_IMAGE}.gif

    Add in displayimage.php after line #99:
    Code: [Select]
    '{PREV_IMAGE}' => ($lang_text_dir=='LTR') ? 'prev' : 'next',
    '{NEXT_IMAGE}' => ($lang_text_dir=='LTR') ? 'next' : 'prev',


    ----------

    8. Problem with e-cards when received to Outlook - the HTML source of the e-card is displayed. This is really an Outlook problem not Coppermine, but there is a way to fix it. The fix was discussed on the forums but is not yet implemented in the development version.

    Fix include/mailer.inc.php lines #32-#37 - just remove the \r from the end of each line.

    The problem with Outlook is that it doesn't recognize mail headers that terminate with \r\n (CR+LF), although the mail RFC does specify \r\n as a legal terminator.

    ----------

    9. Admin buttons and picture navbar buttons not shown on IE 5.X, when using a Right-to-Left language. This is due to the CSS2 "position" property that is used in the style sheet.

    Fix theme/default/style.css: search for position: relative and comment out all occurences. CSS comments are /* ... */ like in C and PHP.

    As far as I've tested removing this property doesn't introduce any problem, and only seems to fix the issue described.

    ----------

    10. The albums displayed in the main page are those that have no category. The administrator can change categories for all albums that are NOT user albums, and so decide which albums display on the first page.
    However, there is no way to put USER albums on the front page!

    The solution is to allow the admin to change the the category of user albums, and also to change the category of an album back to the original user (or any other).

    Fix in modifyalb.php::

    * Change line #122 to:
    Code: [Select]
    if (!GALLERY_ADMIN_MODE) {* Add after line #139 the follwoing section:
    Code: [Select]
    $sql="SELECT DISTINCT(owner_id) FROM {$CONFIG['TABLE_PICTURES']}";
    $result=db_query($sql);
    if (mysql_num_rows($result) > 0) {
    $rowset = db_fetch_rowset($result);
    foreach ($rowset as $user)
    $CAT_LIST[]=array($user['owner_id']+FIRST_USER_CAT, get_username($user['owner_id']));
    }


    ----------

    That's all for now. I hope that the changes will be integrated into the next development release.

    EZ.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Bugs in 1.1.1 and suggested fixes for 1.2.0
« Reply #1 on: October 05, 2003, 11:42:33 pm »

Thanks for your very well documented bug report and the suggested fixes. I committed 2 of the solutions immediately to the dev version and set up a bug tracker for the other 8 in the dev board. I'll keep you updated on the solution of those bugs.

GauGau
Logged

EZ

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 130
Bugs in 1.1.1 and suggested fixes for 1.2.0
« Reply #2 on: October 06, 2003, 06:42:47 pm »

GauGau,

You were too quick... I meant to enter the bugs into the racker myself - thanks for doing it.

Please let me know if you (or other developers) need help if my descriptions aren't clear enough. I'll be glad to help.

Eyal.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Bugs in 1.1.1 and suggested fixes for 1.2.0
« Reply #3 on: October 06, 2003, 08:01:49 pm »

we don't use the tracker of sf.net, we use our own "non-public" tracker, so it wouldn't have helped if you added it :wink:

GauGau
Logged

EZ

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 130
Bugs in 1.1.1 and suggested fixes for 1.2.0
« Reply #4 on: October 09, 2003, 07:11:44 am »

Hi again GauGau,

Can you please tell me which of the fixes you'be applied, and for those that you haven't applied - why?

I'm not trying to pressure you to include all my fixes (well maybe just a little), but I want to know if my fixes do not seem appropriate then maybe I can come up with alternative solutions.

Also, is there any way to access the non-public tracker, and for that matter why not just use the SF tracker?

Thanks and kudos for the wonderful job you do in managing the project.

Eyal.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Bugs in 1.1.1 and suggested fixes for 1.2.0
« Reply #5 on: October 09, 2003, 07:52:49 am »

EZ,

here's your list and some remarks regarding what we're going to do about it:
  • Fix missing scrollbars in full-size image view on Mozilla browsers.
    done
  • Fix incorrect charset in full-size image view.
    done
  • Fix image file size so it works also with Right-To-Left language.
    Although it may seem like a small isssue, we're not happy with the idea of removing the space between the number and the unit, so we'll have to come up with something else. As yo're the specialist in rtl-languages on this board, you may have another idea - how has this been done with other software?
  • Fix login redirect with phpBB.
    Login/logout works differently with most bbs, so the solution you propose may work with phpBB, but not with others. We're still talking this over: should there be a var in the config array the user has to fill that will be the redirect target or should we try to introduce a global var that is filled by the script (it tries to find out the script location). You're right with everything you say, but bbs support is still "experimental"
  • Fix logout redirect with phpBB.
    same as login issue
  • Cosmetic - in thumbnail view align thumbs in middle of table cells.
    we agreed on this, but the changes haven't been committed yet (just a matter of time).
  • Fix next/prev arrow images to work also with RTL languages.
    good idea - we were also talking about "advanced" prev/next buttons (that will be greyed out at the very beginning/end of an album), but this feature probably won't make it into the release (we're having a feature freeze at the moment), so it'll be the next version probably...
  • Fix e-cards for compatability with MS-Outlook.
    has been done afaik
  • Fix probelm when buttons don't show in IE 5.X with RTL language.
    There has been an argument about the usage of "advanced" browser features and the problems they're causing. We're trying to drop the layer completely. Will probably not make it into the release though.
  • Enhancement - Allow admin to change category of user albums.
    very good point - admin should be god (will eventually not make it into the next release)[/list:u]
    The reason for having a non-public bug tracker is simple: not all we talk about on the dev board are bugs, but also features some want this way, some the other. If you discuss this in public, possible future users of coppermine might become frightened, coming to think that coppermine was especially buggy.
    Right now we're also trying to set up a way to add/remove project members and organize the roles inside the team, so there might be a change in our "policy" on bug tracking...

    Thanks for your post

    GauGau

    P.S. could you look your proposed modifications over, some lines are hard to track, as the code we're working on has changed from the 1.1 version you're refering to, so the line numbers have changed. Could you refer to code you want changed this way:
    [search for]
    Code: [Select]
    foo[/search for]
    [replace with]
    Code: [Select]
    foo bar[/replace with]
Logged

EZ

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 130
Bugs in 1.1.1 and suggested fixes for 1.2.0
« Reply #6 on: October 09, 2003, 06:24:25 pm »

GauGau,

Here's some followup:

Quote
Fix missing scrollbars in full-size image view on Mozilla browsers.
done

Good, let's drop it from the list.

Quote
Fix incorrect charset in full-size image view.
done

Ditto.

Quote
Fix image file size so it works also with Right-To-Left language.
Although it may seem like a small isssue, we're not happy with the idea of removing the space between the number and the unit, so we'll have to come up with something else. As yo're the specialist in rtl-languages on this board, you may have another idea - how has this been done with other software?

Yes, there is an alternative - enclose the expression (number + units) in a SPAN tag with hard-coded LTR direction. Sounds more complicated than it actually is, so here's an example:

<span dir="LTR">97 KB</span> -- The tags should of couse go in the template, not the code, so this should be a quick and easy fix.

Don't worry about hard coding directionality, as in this case it's the (only) correct solution. Expert info: The BiDi algorithm uses implied logic and it just can't guess correctly in this case. There may be a somewhat more theoretically standard solution: insert a Unicode LTR character before the expression, and a matching "return to previous direction" character after. But this will only work with Unicode (ie. not with WIN-125X or ISO-8859-X) and I'm not even sure browsers support it.

Note: This raises another issue - some config vars are LTR by nature, such as paths and filenames, etc. Those fields should also be forced to LTR, because in RTL mode they show incorrect data. For example the path httpdocs/gallery/ will show in RTL mode as /httpdocs/gallery - very confusing! This should wait for a later version, no doubt, but can you please add it to the tracker?

Quote
Fix login redirect with phpBB.
Login/logout works differently with most bbs, so the solution you propose may work with phpBB, but not with others. We're still talking this over: should there be a var in the config array the user has to fill that will be the redirect target or should we try to introduce a global var that is filled by the script (it tries to find out the script location). You're right with everything you say, but bbs support is still "experimental"

I understand and agree that another config var is worthy of more thinking and planning. Maybe the right thing to do is add an explanation in the readme for the user to apply the patch with his/her path information (I'm willing to write it). What do you think?

Quote
Fix logout redirect with phpBB.
same as login issue

Not quite. The logout issue requires a simple change on Coppermine side (similar to login) but also a deeper change in phpBB, which is out of the scope of Coppermine. The alternative solution that I've suggested may work around the need to change anything in phpBB, but it's a more involved change and I haven't even tried it yet (although I'm pretty sure it will work).

I agree that the full logout fix can't make it into the coming release, so in the meantime I'll try to test it and also check compatability with phpBB v2.0.5/6. Can't promise a time frame though as I'm really tight on time now.

Quote
Cosmetic - in thumbnail view align thumbs in middle of table cells.
we agreed on this, but the changes haven't been committed yet (just a matter of time).

Ok (but it's a matter of 1-2 minutes).

Quote
Fix next/prev arrow images to work also with RTL languages.
good idea - we were also talking about "advanced" prev/next buttons (that will be greyed out at the very beginning/end of an album), but this feature probably won't make it into the release (we're having a feature freeze at the moment), so it'll be the next version probably...

My code doesn't add any feature, it merely fixes incorrect behavior when the page is in RTL orientation. Also the fix is very small and simple, so it doesn't affect anything else. I think it's worth the 2 minute work...

Quote
Fix e-cards for compatability with MS-Outlook.
has been done afaik

I read an old post (still on chezgreg.net) that the problem was identified and resolved, yet the latest development version did not contain the fix. I suggest to verify that \r is indeed removed. Again this is a 2 minute task that can rid us of an annoying problem that affects many people (all Outlook users).

Quote
Fix probelm when buttons don't show in IE 5.X with RTL language.
There has been an argument about the usage of "advanced" browser features and the problems they're causing. We're trying to drop the layer completely. Will probably not make it into the release though.

I'm not sure I understand the issue with "advanced browsers". The position property isn't used at all so I can't see any issue with removing it. It does nothing except confuse IE 5.X so why not get rid of it?

Quote
Enhancement - Allow admin to change category of user albums.
very good point - admin should be god (will eventually not make it into the next release)

Indeed not an urgent issue. Personally I can patch my own site until the fix is merged into the main distribution.

Quote
The reason for having a non-public bug tracker is simple: not all we talk about on the dev board are bugs, but also features some want this way, some the other. If you discuss this in public, possible future users of coppermine might become frightened, coming to think that coppermine was especially buggy.

That's true for almost any project - see for example the trackers for phpBB, Mozilla, OpenOffice - they are really scary and still the apps are very popular. I wouldn't worry about it. Anyway most new users follow the download link (and then support forums) and only few bother to read docs or check the bug tracker.

Quote
Right now we're also trying to set up a way to add/remove project members and organize the roles inside the team, so there might be a change in our "policy" on bug tracking...

Well it's understandable that you don't want to open everything to everyone until there's some privilige system in place.

It might help to remember that posting to the SF tracker requires registration to SF, which will keep most users in read-only mode. Even I, with my interest with several projects on SF, registered just last week...

Quote
P.S. could you look your proposed modifications over, some lines are hard to track, as the code we're working on has changed from the 1.1 version you're refering to, so the line numbers have changed. Could you refer to code you want changed this way:
[search for]
Code: [Select]
foo[/search for]
[replace with]
Code: [Select]
foo bar[/replace with]


Will do - just please let me know which fixes you intend to apply first and I'll provide the info as you request.

Many thanks!

Eyal.
Logged
Pages: [1]   Go Up
 

Page created in 0.038 seconds with 21 queries.