Problem/Motivation

filelog_install() does not seem to correctly create the .htaccess file.

Steps to reproduce

  1. drush en filelog
  2. The logs/ folder is created but without the .htaccess file.

Proposed resolution

The logic in filelog_install() seems to be wrong. It will not create the .htaccess file if the folder was successfully created.

Remaining tasks

I will submit a patch.

Issue fork filelog-3207566

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

prudloff’s picture

Status: Active » Needs review
cburschka’s picture

Wow, this looks like an ancient logic error created in https://git.drupalcode.org/project/filelog/-/commit/78a84a866ad118fb489f...

The if-condition was reversed (from true on failure, causing logging to be disabled, to true on success, causing logging to be enabled), but instead of turning !A || !B into A && B, we only turned it into A || !B. Thanks for catching that!

cburschka’s picture

StatusFileSize
new1.43 KB
new1.96 KB

I'm expanding the functional test to check for this in the future. Here's a test-only patch.

The last submitted patch, 5: filelog-3207566-5-testonly.patch, failed testing. View results

cburschka’s picture

Patches look good, but the branch needs an upstream merge.

  • cburschka committed 394e79b on 2.0.x authored by prudloff
    Issue #3207566 by cburschka, prudloff: .htaccess file not always created...
cburschka’s picture

Version: 2.0.1 » 2.0.x-dev
Status: Needs review » Fixed

Pushed. Thanks for the fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.