ericlimer Posted July 16, 2022 Share Posted July 16, 2022 (edited) Hello! Alfred newbie here and trying to get an oldish workflow, Datespan, working in Alfred 5 on Monterey. I'm aware part of the trouble is that PHP is no longer packaged with macOS, and I went out and got it through Homebrew. Now the script is doing its calculations, I can tell because when i look at debug mode (output below), I can see the calculations i am looking for, but they don't show up visibly in Alfred. The problem seems to be some sort of depecated XML, but I'm out of my depth here. It's tantalizing because the I know the calculation is working, I just cannot for the life of me figure out how to get Alfred to print it for me. [08:03:53.511] Date Span[Script Filter] Queuing argument ' 2/14' [08:03:53.616] Date Span[Script Filter] Script with argv '(null)' finished [08:03:53.620] STDERR: Date Span[Script Filter] mkdir: /Users/eric/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data: No such file or directory mkdir: /Users/eric/Library/Application Support/Alfred 2/Workflow Data: No such file or directory PHP Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 PHP Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 PHP Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 PHP Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 PHP Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 PHP Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 [08:03:53.623] Date Span[Script Filter] Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 <?xml version="1.0"?> <items><item uid="complete" arg="5 months, 3 days, 8 hours and 3 minutes ago" valid="yes" autocomplete=""><title>5 months, 3 days, 8 hours and 3 minutes ago</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="business weeks" arg="30 business weeks" valid="yes" autocomplete=""><title>30 business weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="weeks" arg="21 weeks" valid="yes" autocomplete=""><title>21 weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="days" arg="152 days" valid="yes" autocomplete=""><title>152 days</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="hours" arg="3,648 hours" valid="yes" autocomplete=""><title>3,648 hours</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="minutes" arg="218,880 minutes" valid="yes" autocomplete=""><title>218,880 minutes</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item></items> [08:03:53.625] ERROR: Date Span[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON: Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 Deprecated: SimpleXMLElement::addAttribute(): Passing null to parameter #2 ($value) of type string is deprecated in /Users/eric/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9023BFC0-576A-4856-90EF-B1D5C4C279AB/workflows.php on line 198 <?xml version="1.0"?> <items><item uid="complete" arg="5 months, 3 days, 8 hours and 3 minutes ago" valid="yes" autocomplete=""><title>5 months, 3 days, 8 hours and 3 minutes ago</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="business weeks" arg="30 business weeks" valid="yes" autocomplete=""><title>30 business weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="weeks" arg="21 weeks" valid="yes" autocomplete=""><title>21 weeks</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="days" arg="152 days" valid="yes" autocomplete=""><title>152 days</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="hours" arg="3,648 hours" valid="yes" autocomplete=""><title>3,648 hours</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item><item uid="minutes" arg="218,880 minutes" valid="yes" autocomplete=""><title>218,880 minutes</title><subtitle>copy to clipboard</subtitle><icon>icon.icns</icon></item></items> Edited July 16, 2022 by ericlimer adding image Link to comment
vitor Posted July 19, 2022 Share Posted July 19, 2022 Welcome @ericlimer, It’s a PHP deprecation causing the issue. Meaning PHP itself changed over the years and a feature is no longer working as before. Small fix, I have submitted a pull request. You can download the fixed version with this link. dacul7 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now