Raistlfiren / garmin-csv-plan

A quick n' dirty way of "automating" training plans into Garmin Connect.
https://raistlfiren.github.io/garmin-csv-plan/
36 stars 6 forks source link

Not able to add workout to calendar #26

Closed Volpesce closed 1 year ago

Volpesce commented 1 year ago

When I try to load a workout, all goes well up to a successful upload of the workouts. The next step fails with: 2023-04-30T22:39:32+02:00 [info] Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated.

Any ideas on how to resolve this issue?

Running on linux with PHP 8.1.2.

Raistlfiren commented 1 year ago

@Volpesce - Thanks for reporting the issue. That looks to be a warning. Is there another error? Do you have a sample of the workouts or the file that I can take a look at and test?

Thanks!

Volpesce commented 1 year ago

Dear @Raistlfiren,

Thank you for putting time in this..

There was no other error (see output below)

The command used (slightly altered, obviously) ./bin/console garmin:workout S2R-5k.csv -m username@garmin -p paswd -s '2023-05-07'

And the output in the terminal.

PHP Warning: Module "curl" is already loaded in Unknown on line 0 Starting workout import/export command

Validating and accessing - S2R-5k.csv

[OK] File valid

Parsing Workouts

  • wk1.1
  • wk1.2
  • wk1.3
  • wk2.2
    • wk2.3
    • wk3.1
    • wk3.2
    • wk3.3 Does the following look correct? (yes/no) [yes]:

Creating workouts

  • Workout - wk1.1 was created on the Garmin website with the id ..........6
  • Workout - wk1.2 was created on the Garmin website with the id ..........8
  • Workout - wk1.3 was created on the Garmin website with the id ..........9
  • Workout - wk2.2 was created on the Garmin website with the id ..........7
  • Workout - wk2.3 was created on the Garmin website with the id ..........3
  • Workout - wk3.1 was created on the Garmin website with the id ..........7
  • Workout - wk3.2 was created on the Garmin website with the id ..........9
  • Workout - wk3.3 was created on the Garmin website with the id ..........0

    [OK] Workout import was successful.

2023-05-03T19:59:19+02:00 [info] Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated'

S2R-5k.csv

Raistlfiren commented 1 year ago

@Volpesce - Thank you for providing the file and the data output. I will check this out either tonight or tomorrow. I hope to have an answer soon.

Raistlfiren commented 1 year ago

@Volpesce - Sorry for the delay in responding as I told you. I tried running the file and it imported successfully. By default, the command will only import the workouts into Garmin Connect. You must add the schedule argument in order to plan them on the calendar too. Both commands worked fine, but I will look into the deprecation notices. Are you not seeing them in your Garmin Connect?

Thanks!

Volpesce commented 1 year ago

@Raistlfiren - It is me who should be sorry..... I completely overlooked the 'schedule' argument..... I assumed the -s was enough to add it to the calendar.

So again, I am very sorry to raise a bug report while it was stupid me all along.

I appreciate the help you gave tremendously, and also to provide this tool for adding training schedules to Garmin connect.

Raistlfiren commented 1 year ago

@Volpesce - Thanks again for the update! You are fine. I think I need to be more clear in the documentation or add a suggestion when running the command with the -s flag. I am glad you reported it because I am sure others have had the same problem. I will consider that when I update the code to fix the deprecation issues.

Cheers! :)