eventespresso / eea-recurring-events-manager

EE4 Recurring Events Manager add-on for Event Espresso 4
GNU General Public License v3.0
0 stars 1 forks source link

Add Recurrence Table and JOIN with Datetimes #28

Closed tn3rb closed 4 years ago

tn3rb commented 4 years ago

This PR:

manzoorwanijk commented 4 years ago

I just tested this branch with the following data in ChromeiQL but got some PHP errors.

mutation CREATE_RECURRENCE($input: CreateEspressoRecurrenceInput!) {
  createEspressoRecurrence(input: $input) {
    espressoRecurrence {
      id
      dbId
      cacheId
      exDates
      exRule
      dateDuration
      name
      rDates
      rRule
    }
  }
}

with these query variables

{
  "input": {
    "name": "every January on the 1st for 1 time",
    "clientMutationId": "ok",
    "rRule": "DTSTART:20201006T115805Z\nRRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1;WKST=MO",
    "exRule": "DTSTART:20201006T115837Z\nRRULE:FREQ=YEARLY;BYMONTH=1;BYMONTHDAY=1;COUNT=1;WKST=MO",
    "dateDuration": "1",
    "rDates": "[]"
  }
}
tn3rb commented 4 years ago

Do we want to keep gDates in the database?

that was removed in this commit: https://github.com/eventespresso/eea-recurring-events-manager/pull/28/commits/787f8d8ef02f3de6ee21058f9eb633bc906faef7

DOM data for REM needs to be wired up. May in next PR if now this.

yes another PR

I just tested this branch with the following data in ChromeiQL but got some PHP errors.

can you post the errors plz in case I don't get them?

manzoorwanijk commented 4 years ago
WordPress database error Unknown column 'RCR_date_duration' in 'field list' for query INSERT INTO
`wp_esp_recurrence` (`RCR_name`, `RCR_rRule`, `RCR_exRule`, `RCR_rDates`, `RCR_date_duration`, `RCR_sales_start_offset`,
`RCR_sales_end_offset`) VALUES ('some r rule name', 'STRART:NULL', 'OKTEST', '[]', '1', '1 month before start', '1 hour before start')
WordPress database error Unknown column 'wp_esp_datetime' in 'where clause' for query SELECT COLUMN_NAME
                FROM INFORMATION_SCHEMA.COLUMNS 
                WHERE table_name = `wp_esp_datetime` 
                AND column_name = 'RCR_ID';
Method generatedDatesJson on class EE_Recurrence does not exist! You can create one with the following code in functions.php or in a plugin: add_filter('FHEE__EE_Recurrence__generatedDatesJson',&#039
tn3rb commented 4 years ago

have you tried turning it off and then on again

ie: try de-re-activating the REM plugin so that the DMS can run. if that doesn't work, then delete the recurrence table and manually remove the RCR_ID field from the datetimes table, then try de-re-activating again

nicolad commented 4 years ago

have you tried turning it off and then on again

image

manzoorwanijk commented 4 years ago

The last error is not a DB error 🙄

tn3rb commented 4 years ago

looks like I forgot to remove the GQL field from \EventEspresso\RecurringEvents\domain\services\graphql\types\Recurrence::getFields()

my IDE didn't detect that since the method is only referenced via a string and not directly in any way:

new GraphQLField(
    'gDates',
    'String',
    'generatedDatesJson',
    esc_html__('Generated Dates', 'event_espresso')
),
tn3rb commented 4 years ago

FINALLY got the ^%$#%^$#$#^ tests to run properly on Travis!!!

only have a couple of super basic tests so far but at least they are running now