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

Currency converter doesn't work #103

Closed
andredrodrigues opened this issue Mar 20, 2023 · 16 comments
Closed

Currency converter doesn't work #103

andredrodrigues opened this issue Mar 20, 2023 · 16 comments

Comments

@andredrodrigues
Copy link

If you have a problem with the workflow please answer the following questions.

Are you using the latest version of the workflow?

  • Yes

Describe the bug

  • Unable to convert currencies

To Reproduce
Steps to reproduce the behavior:

  1. Open Alfred
  2. Type '188 cny'
  3. See the message saying 'Updating Currency Rates...'
  4. Nothing happens.

Expected behavior
I expected to see the currency I prompted (188 cny), exchanged into all the other currencies on the list (USD, EUR, ...)

Debug Output
[17:34:38.932] Logging Started...
[17:34:53.385] Calculate Anything[Script Filter] Queuing argument ''
[17:34:53.467] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:53.470] Calculate Anything[Script Filter] {"items":[]}
[17:34:53.504] Calculate Anything[Script Filter] Queuing argument '8'
[17:34:53.638] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:53.643] Calculate Anything[Script Filter] {"items":[]}
[17:34:53.645] Calculate Anything[Script Filter] Queuing argument '88'
[17:34:53.720] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:53.724] Calculate Anything[Script Filter] {"items":[]}
[17:34:53.776] Calculate Anything[Script Filter] Queuing argument '88 '
[17:34:53.921] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:53.926] Calculate Anything[Script Filter] {"items":[]}
[17:34:53.928] Calculate Anything[Script Filter] Queuing argument '88 c'
[17:34:54.014] Calculate Anything[Script Filter] Queuing argument '88 cn'
[17:34:54.137] Calculate Anything[Script Filter] Queuing argument '88 cny'
[17:34:54.163] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:54.166] Calculate Anything[Script Filter] {"items":[]}
[17:34:54.433] Calculate Anything[External] Processing complete
[17:34:54.438] Calculate Anything[External] Passing output 'last_update_check|1679333694|false' to Split Arg
[17:34:54.440] Calculate Anything[Split Arg] Processing complete
[17:34:54.441] Calculate Anything[Split Arg] Passing output 'last_update_check|1679333694|false' to Arg and Vars
[17:34:54.443] Calculate Anything[Arg and Vars] Processing complete
[17:34:54.445] Calculate Anything[Arg and Vars] Passing output 'last_update_check|1679333694|false' to Run Script
[17:34:54.450] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:54.451] Calculate Anything[Script Filter] {"items":[{"title":"Updating currency rates...","valid":false,"arg":""}],"rerun":0.2,"variables":{"rerun":true}}
[17:34:54.643] Calculate Anything[Script Filter] Queuing argument '88 cny'
[17:34:55.168] Calculate Anything[External] Processing complete
[17:34:55.174] Calculate Anything[External] Passing output 'last_update_check|1679333694|false' to Split Arg
[17:34:55.176] Calculate Anything[Split Arg] Processing complete
[17:34:55.177] Calculate Anything[Split Arg] Passing output 'last_update_check|1679333694|false' to Arg and Vars
[17:34:55.178] Calculate Anything[Arg and Vars] Processing complete
[17:34:55.180] Calculate Anything[Arg and Vars] Passing output 'last_update_check|1679333694|false' to Run Script
[17:34:55.186] Calculate Anything[Script Filter] Script with argv '(null)' finished
[17:34:55.188] STDERR: Calculate Anything[Script Filter] PHP Warning: Undefined array key "message" in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 467
PHP Warning: Trying to access array offset on value of type float in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 287
PHP Warning: Trying to access array offset on value of type float in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 289
[17:34:55.189] Calculate Anything[Script Filter] Warning: Undefined array key "message" in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 467

Warning: Trying to access array offset on value of type float in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 287

Warning: Trying to access array offset on value of type float in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 289
{"items":[{"title":"0.00 reload","subtitle":"1 CNY = 0.00 reload","arg":"0.00","icon":{"path":"assets/flags/reload.png"},"mods":{"cmd":{"valid":true,"arg":0,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":0,"subtitle":"Action this item to copy the value of 1 to the clipboard"}}},{"title":"0.00 EUR","subtitle":"1 CNY = 0.00 EUR","arg":"0.00","icon":{"path":"assets/flags/EUR.png"},"mods":{"cmd":{"valid":true,"arg":0,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":0,"subtitle":"Action this item to copy the value of 1 to the clipboard"}}}]}
[17:34:55.192] ERROR: Calculate Anything[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:
Warning: Undefined array key "message" in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 467

Warning: Trying to access array offset on value of type float in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 287

Warning: Trying to access array offset on value of type float in /Users/andre/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.17AB9CC1-84A8-4E5C-8FDC-E7F48DA85E28/workflow/tools/currency.php on line 289
{"items":[{"title":"0.00 reload","subtitle":"1 CNY = 0.00 reload","arg":"0.00","icon":{"path":"assets/flags/reload.png"},"mods":{"cmd":{"valid":true,"arg":0,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":0,"subtitle":"Action this item to copy the value of 1 to the clipboard"}}},{"title":"0.00 EUR","subtitle":"1 CNY = 0.00 EUR","arg":"0.00","icon":{"path":"assets/flags/EUR.png"},"mods":{"cmd":{"valid":true,"arg":0,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":0,"subtitle":"Action this item to copy the value of 1 to the clipboard"}}}]}

System information:

  • OS: Mac OS Ventura 13.1
  • Alfred Version 5.0.6 [2110]
  • PHP Version 8.2.3

Additional context
Add any other context about the problem here.

@arvidbjorkstrom
Copy link

To be clear, are you using the 4.0.0 version of the workflow?

Have you set a fixer API key?

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 21, 2023 via email

@biati-digital
Copy link
Owner

@andrerodrigues6 If you are not able to use the currency conversion then it simply means one thing. The workflow is not able to get the rates from an external website. Why? there's multiple reasons for this, for example:

  • You are using a software that blocks outgoing connections
  • You are using a firewall to block connections
  • Your network only allows certain URL's
  • Your PHP version does not include curl, this is rare but possible.

Can you please confirm that you are not using an app or firewall to block outgoing connections?

If that's not the case i will send you another version of the workflow for you to try so we can get more debug information about the specific error you are receiving.

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 21, 2023 via email

@biati-digital
Copy link
Owner

Hi @andrerodrigues6 thank's for the reply. Ok, please install this version, it's modified to display more information about the requests to the API to see if we can find a problem.

1.- Please install this version
2.- Open the debug pane and make sure to hit the clear button
3.- Launch Alfred and Paste 100 usd eur it's important that you paste it and not type it otherwise the debug output will be huge
4.- Share the debug output.

CleanShot 2023-03-22 at 04 31 11

Click here to download the workflow
Calculate Anything.zip

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 22, 2023 via email

@biati-digital
Copy link
Owner

Hi @andrerodrigues6 thank's for following the steps, your output is not executing the request to the external server, probably because it's getting the cached file, please open Alfred and type _caclear and press enter, this should remove the cache and again Launch Alfred and Paste 100 usd eur and share with us the output.

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 22, 2023 via email

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 22, 2023 via email

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 22, 2023 via email

@biati-digital
Copy link
Owner

Thank's for the output. You have curl enabled but it's not able to establish a secure connection, it returns an error about the certificate on your system, this is not a problem with the external API's or the code, please download and install this new version just to see if we are able to tell curl to connect anyway.

Download and install this 👇 and please do the steps again.
Calculate Anything.zip

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 22, 2023 via email

@biati-digital
Copy link
Owner

Hi @andrerodrigues6 no problem, thank's to you we found the problem and a solution, as you can see in your debug output now the workflow it's able to connect and get the rates correctly. We'll release an update today and it should work correctly for you now.

Again thank's for your help, i'll notify you here once the update is released.

@biati-digital
Copy link
Owner

The new update has been released 4.0.1 please remove your current workflow and give this one a try.

@andredrodrigues
Copy link
Author

andredrodrigues commented Mar 23, 2023 via email

@biati-digital
Copy link
Owner

@andrerodrigues6 No problem, i'm glad we found a solution and thank you for doing all the testing.

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

No branches or pull requests

3 participants