Menu

Cannot remove direct link

Help
2009-12-28
2013-05-03
  • Martijn Kuipers

    Martijn Kuipers - 2009-12-28

    Hi,
    Just trying out the program and hit a small bug.
    I set a direct link, but since links on the net are known to disappear I downloaded the paper and wanted to upload it.

    I know there is a preference for direct link over user upload, but I can't "unset" the direct link.

    How do you remove a direct link?

    /Martijn

     
  • Lorenzo Bettini

    Lorenzo Bettini - 2009-12-28

    Yes, this is actually a bug I had never experienced (but I checked this right now and confirm it).

    the problem is in **papers\_fun.php** in particular in the **handle\_upload** function.

    You need to replace this code:

        // if it's an url we avoid to try to deal with an uploaded file, since
        // a direct link has the precedence
    if (is_url($value)) {
        return $value;
    } else {
        return papers_class::handle_upload($field);
    }

    with this one

        // if it's an url we avoid to try to deal with an uploaded file, since
        // a direct link has the precedence
    if (is_url($value)) {
        return $_REQUEST;
    } else {
        return papers_class::handle_upload($field);
    }

    and this will fix this problem (please confirm this and I'll release a fixed version).

    Notice however that you'll need to modify the paper twice: the first one for deleting the link, the second one to upload the file. This is due to the way file upload and link are (badly) mixed.

    Phpbibliography is going under heavy restyling and rewriting, and this mechanism for file upload and links will be improved.

     
  • Martijn Kuipers

    Martijn Kuipers - 2009-12-28

    I can confirm that it works.

    Looking forward to the restyling/rewriting part.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.