Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSet erroronmissingdir attribute does not work #1856

Closed
demiankatz opened this issue Aug 9, 2024 · 3 comments
Closed

FileSet erroronmissingdir attribute does not work #1856

demiankatz opened this issue Aug 9, 2024 · 3 comments
Milestone

Comments

@demiankatz
Copy link

demiankatz commented Aug 9, 2024

Describe the bug
In version 3.0.0, the erroronmissingdir of FileSet does not work. It is a documented setting, but when I add the attribute to my FileSet, Phing fails with Phing\Type\FileSet doesn't support the 'erroronmissingdir' attribute. I took a look at the code and found that there is an errorOnMissingDir property in the AbstractFileSet class; the error seems to be caused by a missing getter. I tried editing the class to add this getter:

    public function setErrorOnMissingDir($errorOnMissingDir)
    {
        $this->errorOnMissingDir = $errorOnMissingDir;
    }

This eliminates the error message, but the property seems to have no effect -- even though it defaults to false, I seem to always get the "true" behavior. I want to be able to get an empty file set if pointing at a non-existent directory.

Steps To Reproduce
This is the task in my build.xml that is failing.

  <target name="import_authorities" description="import all authority test records">
    <foreach param="relfilename" absparam="filename" target="importauthrec">
      <fileset dir="${marc_authority_dir}" erroronmissingdir="false">
          <include name="*.mrc" />
      </fileset>
    </foreach>
  </target>

Expected behavior

I expected the attribute to be supported and to work as documented, instead of to be unsupported and not work at all.

Additional context

Please let me know if I can do anything more to help, and thanks for Phing, which has been a valuable tool for my project. This is not an emergency as I'm sure I can work around the limitation -- but it would be nice to have all documented features working correctly in future.

@mrook
Copy link
Member

mrook commented Sep 5, 2024

Thanks for the report @demiankatz ! If you'd like to contribute, there are other issues currently open and looking for pull requests :-)

@demiankatz
Copy link
Author

Thanks for the report @demiankatz ! If you'd like to contribute, there are other issues currently open and looking for pull requests :-)

Have you considered adding a "good first issue" tag to help point people to reasonable starting points for contribution? That might be helpful for newcomers!

I'm working through my own backlog at the moment, but I'm certainly open to contributing in future, especially if it helps to ensure the project remains active and healthy. Feel free to call on me if there's ever an issue that needs attention and isn't getting enough. :-)

@mrook
Copy link
Member

mrook commented Sep 5, 2024

Good suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants