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

String[1] forbids empty php::settings value #639

Closed
antondollmaier opened this issue Aug 26, 2021 · 3 comments · Fixed by #640
Closed

String[1] forbids empty php::settings value #639

antondollmaier opened this issue Aug 26, 2021 · 3 comments · Fixed by #640

Comments

@antondollmaier
Copy link

Hi folks,

this issue appears since latest 8.0.0 / #634.

Affected Puppet, Ruby, OS and module versions/distributions

  • Module version: 8.0.0

How to reproduce (e.g Puppet code you use)

Excerpt:

class php {
  settings => {
    'PHP/user_ini.filename' => '',
  }
}

What are you seeing

Error while evaluating a Resource Statement, Php::Config::Setting[/opt/php-7.2/etc/php.ini: PHP/user_ini.filename]: parameter 'value' expects a value of type Integer or String[1], got String (file: /etc/puppetlabs/code/environments/production/modules/php/manifests/config.pp, line: 28)`

What behaviour did you expect instead

set user_ini.filename to empty value in the mentioned php.ini.

Any additional information you'd like to impart

The empty string is valid:

https://www.php.net/manual/en/configuration.file.per-user.php

With the empty value on PHP/user_ini.filename, PHP doesn't scan for a user-maintained php.ini.

Changing php::config::setting from Variant[Integer, String[1]] to Variant[Integer, String] solves the issue, obviously - but I doubt that's actually the best or preferred approach.

@smortex
Copy link
Member

smortex commented Aug 26, 2021

Ah! I could not find a setting that has a default value that can be overridden by an empty string, but they seem to exist.

I opened #640 to fix this issue.

@antondollmaier
Copy link
Author

So, "bingo"? :)

Thanks for addressing so fast!

@smortex
Copy link
Member

smortex commented Aug 27, 2021

8.0.1 was released with the fix. Thanks for reporting the issue quickly!

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

Successfully merging a pull request may close this issue.

2 participants