ryan

Profile Export module (also upgrade PW 2.0 to 2.1)

Recommended Posts

PROCESSWIRE PROFILE EXPORTER


This module serves two purposes:

  • To enable exporting of ProcessWire 2.0 sites to a profile that can then be imported into ProcessWire 2.1 (i.e. to upgrade to 2.1).
  • To enable exporting of ProcessWire 2.1 site profiles for sharing or distribution with others.

In either case, the profile exporter does not touch your existing site. It just creates files in a directory (/site/install/) that can then be used for a fresh installation of ProcessWire.

PLEASE NOTE: Consider this module alpha test only. It has not had a lot of use or testing yet so it's advisable to use it in a test environment and not on a production server at this time. I am posting this for those that indicated they wanted to help test the PW 2.0 to 2.1 upgrade process.

HOW TO INSTALL


  • Download at: https://github.com/r...ssExportProfile
  • Place the file ProcessExportProfile.module in /site/modules/
  • Login to your admin, click "Modules" at the top, and click "Check for new modules"
  • Click "install" for the Process > Export Profile module.
  • It will create a new page where you can access it under the Setup menu.

HOW TO EXPORT A PROFILE


A profile consists of your site's database, files and templates. To create a profile, Go to Setup > Export Profile. Read the instructions and continue.

Once the profile has been created, you can copy it somewhere else, zip it up, or [if performing an upgrade] copy it directly into your PW 2.1 directory as indicated in the 'upgrading' section below. The profile consists of files in these directories:

/site/install/                  < required
/site/templates/                < required
/site/modules/                  < optional: use only if you have custom modules to include in the profile
/site/templates-admin/          < optional: use only if you have a custom admin theme to include in the profile
/site/assets/                   < optional: use only if exporting all of /site/, and it should be left empty like PW's default profile*
/site/config.php                < optional: use only if you want to specify custom config settings, leave out otherwise**

These directories collectively form the entire /site/ structure of a ProcessWire installation.

If using the profile to upgrade ProcessWire from 2.0 to 2.1 then you'll only want the first two directories above (install and templates)–see the 'Upgrading' section following this one, as the instructions for upgrading are a little different than if you were exporting profiles for distribution.

If you intend to share/distribute your profile with others (as opposed to upgrading), you'll want to ZIP them up into an archive (or use something like GitHub). You may want to make your profile include the entire /site/ directory for easier installation by others. If using the entire /site/ directory as your profile, then just copy all the /site/ files from ProcessWire's default uninstalled profile and replace the directories/files that you want to. For instance, you'll always want to replace the /site/install/ and /site/templates/ directories, but if your profile doesn't include plugin modules or configuration file changes, then you'd keep the default /site/config.php file and /site/modules/ directory from ProcessWire's default profile.

*Any time you are including the entire /site/ directory as your profile, you'll want to include the /site/assets/ directory exactly as it is in the default ProcessWire uninstalled profile. That means the directory is empty, minus an index.php file. During installation, the installer copies files from /site/install/files/ to /site/assets/files/ and ensures they are writable. ProcessWire's installer also creates several other directories under /site/assets. But you don't need to worry about that.

**If you ever do include a /site/config.php in your profile, make sure to remove the last 5 lines that contain confidential information about your database and user system hash.

Once you've saved your profile somewhere else, you should delete the files that this module saved in /site/install/ (they might be consuming a lot of disk space). You'll see a link to do this after you've finished exporting a profile.

UPGRADING FROM PROCESSWIRE 2.0 TO 2.1


This upgrade process is a little different from what you may have seen before. We won't actually be upgrading your current site. Instead we'll be exporting a profile of it, and using it to install a new/fresh copy of ProcessWire 2.1.

To make this work, you'll have to install your copy of ProcessWire 2.1 in another location or another server. Once you've completed the installation and verified that everything is how it should be, you may then replace the original ProcessWire 2.0 site with the new one.

It should be noted that this upgrade does not cover user accounts or access control. You will have to re-create any user accounts and access settings in the new system. This was necessary because PW 2.1 uses an entirely different user system and access control than PW 2.0. Should you have a lot of user accounts that need to be converted, let me know more in the PW forums and I can guide you through how to handle your specific case.

Performing the upgrade

1. Export a site profile as described in the previous section.

2. Download the latest copy of ProcessWire 2.1 at http://processwire.com/download/ and install in a new location. If you are installing on the same server in a different directroy, then don't use the same database as you did in 2.0. Instead create a new database that you will be using for 2.1.

3. Before starting the 2.1 installer, copy these directories from your ProcessWire 2.0 installation to your ProcessWire 2.1 files (completely replacing the directories in the 2.1 files):

/site/install/    =>   /site-default/install/
/site/templates/  =>   /site-default/templates/

4. Now run the ProcessWire 2.1 installer by loading the URL to it in your browser. If all goes as it should, you'll see your 2.0 site now running 2.1.

There are some likely issues that may occur, so read the following section about troubleshooting whether you think you need to or not.

2.0 TO 2.1 UPGRADE TROUBLESHOOTING


I installed 2.1 using the new profile but now I get a 404 Not Found for every page

If you run into this problem, login to ProcessWire 2.1 (/processwire/), edit the template used by your homepage, click the "access" tab and "yes". Then check the box for "guest" view access, and save. Your site should now be functional.

I installed 2.1 using the new profile but now many pages have no title

ProcessWire 2.0 assumed that all pages had a title field whether it was ever officially assigned to the template or not. ProcessWire 2.1 is different in this regard. So if you run into pages without titles, edit the templates used by those pages, add the field 'title' and hit save. The issue should now be fixed.

I ran out of memory or had a timeout when exporting a profile or installing the 2.1 site with the profile

On a large site, it's possible that the resources dedicated to PHP might not be enough for the exporter or installer to complete it's job. Should this happen to you, we may need to do one or more parts of the process manually. So if you run into this scenario, please post in the forum and we'll get it figured out.

I installed 2.1 and all went well but I now have a non-working "Export Profile" page on my Setup menu (last item)

This is the page used by the Profile Exporter module on your 2.0 site. Your 2.1 site won't have the Profile Exporter installed and you can safely delete this page or drag it to the trash.

  • Like 2

Share this post


Link to post
Share on other sites

This is great news! Really looking forward to seeing community built site profiles!

Share this post


Link to post
Share on other sites

Thanks Ryan, this is going to be a really useful module. With a system as flexible as PW, everyone will have their own ideas for how something should be built. It will be interesting to see what best practices and patterns turn up with the sharing of site profiles in the community. And of course it will be great for new users to get started with some ready made packages.

I've just tested on my local machine exporting a 2.1 site. I had an issue with the modules which I did not copy over.

All went well up to the "create admin" screen. After clicking create, it threw an error about the Gmap module. Copying the modules over did not fix anything, and I ended up starting again from a fresh DB. This time I copied all the modules folder first :

site/install
site/templates
site/modules

I then ran the install again and it went through fine.

You also might want to remind users after the install / migration that all the user permissions will need to be updated again. Otherwise everything is working great.

Thanks again,

Michael

Share this post


Link to post
Share on other sites

Michael, thanks for testing that. I have updated the instructions on this page (under the 'How to export a profile' section) to account for this. It now includes the /site/modules/ directory as an optional inclusion. And the same applies to /site/templates-admin/ and /site/config.php. Everything has to be ready-to-go in the import profile before the PW installer is run.

Share this post


Link to post
Share on other sites

I tried to transfer a 2.1 site with this module. I had following issues:

- user emails were lost

- user roles were lost for the users. (I had to reassign the roles for all users, but the roles were not lost)

I assumed this was going to be an issue with an upgrade from 2.0 to 2.1 because the user system has changed. But this was just a 2.1 to 2.1 transfer.

Next up, I'm going to try to upgrade a 2.0 to 2.1, I'll let you guys know how it went!

Share this post


Link to post
Share on other sites

Thanks for testing it out. This module is a bit of a work in progress that is more ready for upgrading PW 2.0 to 2.1 than it is for anything else, and that's where I've focused my attention and testing in the short term. I decided to get it out sooner rather than later since there were several people asking for the ability to upgrade PW 2.0. Though it's not far off from more since the process is so similar. However, profiles are more accurately termed 'installation profiles' so they aren't meant to include user accounts. The fact that it included user accounts at all in your export would mean that's a bug I have to fix. :) Though the intention is that this module will give you the option to include or exclude user accounts. For instance, if you want to export a profile for migration of a site from dev to live, then you could export a profile that includes user accounts. That will probably come in the next version.

Share this post


Link to post
Share on other sites

Thanks for that clarification. I gave this another go at another site I'm building, in which I actually need some functions of 2.1. Pages display properly, only 1 problem: I don't get my tree in the admin screen anymore!

[edit] Sorted it out. I accidently switched the 2.0 wire with the 2.1. Was a bit in a hurry..

Share this post


Link to post
Share on other sites

Ryan i got an exception after the upgrade from 2.0 to 2.1, after the admin creation step  :(

Exception: Unable to add field '' to Fieldgroup 'annuncio' (in /home/daydule/public_html/wire/core/Fieldgroup.php line 83)

This error message was shown because /install.php still exists. Error has been logged.

Share this post


Link to post
Share on other sites

It sounds like there is reference to a field no longer in use in your fieldgroups_fields. Not sure why it would be there, but we need to remove it. Because your new copy of PW won't run at present, It'll have to be done from PhpMyAdmin (or another MySQL client). It sounds like the install actually may have finished, so try this on your new PW 2.1 database, rather than the old one. Open the PW database in PhpMyAdmin, click the "SQL" tab at the top,  paste in the following query and click "go":

SELECT fieldgroups_fields.fieldgroups_id, fieldgroups_fields.fields_id 
FROM `fieldgroups_fields` 
LEFT JOIN fields ON fieldgroups_fields.fields_id=fields.id 
WHERE fields.id IS NULL;

The results will show you any matches that don't belong there. Click the red "x" next to any matches to delete them. Then try to open your site in the browser and see if that fixes it.

Share this post


Link to post
Share on other sites

Thanks for this, Ryan. It looks really useful for both migrating sites and creating a boilerplate PW installation with the regular templates and pages I always use!

Share this post


Link to post
Share on other sites

just upgraded from 2.0 to 2.2.. all seems well, except in the admin:

1. the ACCESS -> USERS page produces error:

Error Call to a member function get() on a non-object (line 93 of /var/www/vhosts/mysite/pw2/wire/modules/Process/ProcessPageType/ProcessPageType.module)

Share this post


Link to post
Share on other sites

Peter, go to Modules > Process > Users.

In the Users config screen under the heading "What fields should be displayed in the page listing?" it should say:

name

email

roles

Are you seeing something different? Double check that you have an 'email' field in your system too. (Setup > Fields)

Share this post


Link to post
Share on other sites

thanks, that seemed to take care of it... at first the email field was not there, just name and roles. then I went to fields, and turned the filter to show built-in fields, and then the email field showed up over in process > users.

thankyou! pb

Share this post


Link to post
Share on other sites

I thought my upgrade was all set, but I get the following error when I try to add a new page...

Error Call to undefined method stdClass::getInputfield() (line 171 of /var/www/vhosts/mysite.com/httpdocs/pw2/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module)

Share this post


Link to post
Share on other sites

When you try to add that new page, do you have the choice of selecting which template? If not, try adjusting your 'family' setting on the parent page's template and temporarily adjust it to not have a defined child template here. Just in case some data is amiss, also edit the template (Setup > Templates > your new page template) and save it. Do the same for the template used by the parent of the page you are trying to add. Lastly, do the same for the 'title' field (Setup > Fields > title). The purpose of this is to refresh the config data for the relevant templates/fields there, just in case there is some leftover PW 2.0 setting, re-saving those templates/fields should clear it out.

Share this post


Link to post
Share on other sites

ok, when I remove "Allowed template(s) for children" and save, the error goes away, but as soon as I re-add it, the error returns... only the top level template has a title field, but I can't delete it, as it says:

Field "title" may not be removed because it is globally required by all fieldgroups

is there anything else I can flush out or reset?

Share this post


Link to post
Share on other sites

I think that may be the problem here, as title is a required field. How do you have templates without a title? PW requires a title from all templates, except in specific cases. The ProcessPageAdd module assumes your template has a title field. When it finds there is none, that's where the exception is getting thrown (I think). I'm thinking you can fix this just by adding a title field to any of your templates that lack it, but still wondering how the templates were created without one. (Perhaps something about PW 2.0 that I don't remember). :)

Share this post


Link to post
Share on other sites

adding title field solved, thanks... how I made templates without them, I do not know... pb

  • Like 1

Share this post


Link to post
Share on other sites

The Exporter doesn't seem to work when using Multi-site setup. The module keeps asking me to create the /site/install/ directory, but I can't do that because I'm using a /site-domain/ directory instead of the regular /site/.

Share this post


Link to post
Share on other sites

Thanks for finding that Diogo. It looks like it was not yet multi-site aware. I have just updated it so that it should be now.

  • Like 1

Share this post


Link to post
Share on other sites

I'm trying to create a Multilanguage profile export. I have changed the title to be PageTitleLanguage.

Now the export went well, but when I try to install the profile I get this error

Unknown column 'data1011' in 'field list'

It installs and all works except that the title field is back to a normal title field, and all titles are gone (empty). Which means it doesn't work.

Share this post


Link to post
Share on other sites

I'm not surprised that the profile exporter module doesn't work with multi language fields just because it was written before multi language fields existed. Though it's not totally clear to me why it wouldn't work, since the multi-language values become part of the regular field data. I'll have to experiment with it and update the profile exporter module to support them. When you imported the profile, did it show the Languages module as arleady installed, or did you have to install it after importing the module?

Share this post


Link to post
Share on other sites

Languages module were installed and regular text language fields where ok just not the page title.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By thomasaull
      Some time ago I created a site profile for creation of a REST API with ProcessWire. Since I kept struggeling with updating stuff between different projects which use this, I decided to convert it into a module. It is now ready for testing: https://github.com/thomasaull/RestApi
      Additionally I added a few small features:
      automatic creation of JWT Secret at module install routes can be flagged as auth: false, which makes them publicly accessible even though JWT Auth is activated in module settings To check things out, download and install the module and check the folder /site/api for examples.
      If you find any bugs or can think of improvements, please let me know!
    • By kongondo
      Sites Manager
       
      16 September 2018:
      FOR NOW, PLEASE DO NOT USE THIS MODULE IN A PRODUCTION SITE. A  RECENT ProcessWire UPDATE HAS BROKEN THE MODULE. I AM WORKING ON A FIX.
       
      ################
       
      Sites Manager is a module for ProcessWire that allows Superusers to easily create/install ProcessWire sites on the same serverspace the module is running in. Only Superusers can use the module. You can create both stand-alone and multi-sites.
       
      Single/Stand-alone Sites
      Stand-alone or single-sites are sites that will run in their own document root/directory with their own wire and site folders, .htaccess, index.php, etc. In other words, a normal ProcessWire site.
      Multiple Sites
      Multi-sites are sites that will run off one wire folder (shared amongst two or more sites) each having their own site folder and database. In this regard, it is important to note that Sites Manager is not in itself a multiple sites solution! Rather, it is a utility that helps you create multi-sites to be run using the ProcessWire core multiple sites feature. For more on this core feature, see the official ProcessWire documentation, specifically the solution referred to as Option #1.
      Option #1 approach requires the site admin to initially install ProcessWire in a temporary directory for each new site. The directory then needs to be renamed as site-xxx, where ‘xxx’ is any name you want to use to differentiate the installation from other sites, before it is moved to the webroot. For instance, site-mysite, site-another, site-whatever. In addition, the /wire/index.config.php file must be copied/moved to the webroot. Each time a site is added, the index.config.php has to be edited to add ‘domain’ => ‘site-directory’ key=>value pairs for the site. This process can become a bit tedious. This module aims to automate the whole multi-site site creation process.
      The module is based off the official ProcessWire installer. Creating a site is as simple as completing and submitting a single form! You also have the option to type and paste values or reuse a pre-defined install configuration.
       
      The module will:
      Install a ProcessWire site in your named directory, applying chmod values as specified
      Move the directory to your webroot
      Update/Create a Superuser account as per the submitted form, including setting the desired admin theme and colour
      For multi sites, update sites.json (used by index.config.php to get array of installed sites)
       
      For multi sites, the only difference in relation to the core multi-sites index.config.php is that this file is slightly different from the one that ships with ProcessWire.
      Download from GitHub: Sites Manager (Beta Release)
      Features
      Install unlimited number of sites in one (multi-sites) or independent (single-site) ProcessWire installs. Install by completing a Form, Typing or pasting in configurations or using pre-created install configurations. Choose an Admin Theme to auto-install along with the site installation. For single-sites installation, download, save and reuse ProcessWire versions of your choice. Install and maintain site profiles for reuse to create other sites. Create install configurations to speed up installation tasks. Client and server-side validation of site creation values. Edit uploaded profiles (e.g., replace profile file). Lock installed sites, configurations and profiles to prevent editing. Bulk delete items such as site profiles, installed site directories and/or databases (confirmation required for latter two). View important site details (admin login, chmod, etc). Links to installed sites home and admin pages. Timezones auto-complete/-suggest. Pre-requisites, Installation & Usage
      Please see the documentation.
      Technicalities/Issues
      Only Superusers can use the module.
      ProcessWire 2.7 - 3.x compatible
      Currently using ProcessWire 2.7 installer (install.php)
      For multi-sites, potential race condition when sites.json is being updated on a new site install vs. index.config.php accessing the json file?
      Not tested with sub-directory installs (for instance localhost/pw/my-site-here/)
      Currently not doing the extra/experimental database stuff (database charset and engine)
      Future Possibilities
      Install specified modules along with the ProcessWire install
      Profile previews?
      Credits
      @ryan: for the ProcessWire installer
      @abdus: for the index.config.php reading from JSON idea
      @swampmusic: for the challenge
      Video Demo
      Demo  showing how quick module works on a remote server [YMMV!]. Video shows downloading and processing two versions of ProcessWire (~takes 7 seconds) and installing a single/stand-alone ProcessWire 3 site using the new Admin Theme UI Kit (~2 seconds) on a remote server.
       
      Screens
      1

      2

       
       
    • By Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. Unpublished and hidden pages are indicated in the dropdowns with similar styling to that used in Page List. If the option to include uneditable pages is selected then those pages are indicated by italics with a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. If the current user is allowed to add new pages under the parent page an "Add New" link is shown at the bottom of the breadcrumb dropdown. If the currently edited page has children or the user may add children, a caret at the end of the breadcrumbs reveals a dropdown of up to the first 25 children and/or an "Add New" link. Overriding the listed siblings for a page
      If you want to override the siblings that are listed in the dropdowns you can hook the BreadcrumbDropdowns::getSiblingsmethod and change the returned PageArray. For most use cases this won't be necessary.
      Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By bernhard
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/FieldtypeRockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
      Changelog: https://gitlab.com/baumrock/FieldtypeRockGrid/raw/master/changelog.md
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour (excl vat).
       
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module:

    • By Ken Muldrew
      I'm trying to get a short routine to run once per day that will look at some pages and send a reminder email when that customer's subscription (yearly) is about to expire. When I run the code in a template then it works without issue, but inside my lazycron service routine, I get an "Error: Uncaught Error: Call to a member function get() on null" as if the database cannot be found. My autoload module is just the sample HelloWorld module included with ProcessWire, editted to perform this task. The whole of it is included below (I've stripped out the code that generates the email because it never gets past $pages->find):
       
      <?php namespace ProcessWire;
      /**
       * ProcessWire 'LazyCronLoad'  module
       *
       */
      class LazyCronLoad extends WireData implements Module {
          public static function getModuleInfo() {
              return array(
                  'title' => 'LazyCronLoad', 
                  'version' => 1, 
                  'summary' => 'Just loads a lazy cron callback.',
                  'singular' => true, 
                  'autoload' => true, 
                  );
          }
          public function init() {
              // initialize the hook in the AutoLoad module
              $this->addHook('LazyCron::everyDay', $this, 'myHook');
              
          }
          public function myHook(HookEvent $e) {
              // called once per day
              wire('log')->save('user_activities',' lazy cron service routine');
                  $transport_pages = $pages->find("template=aggregate-entry, aggregate_type.title='Transport'");
                  foreach ($transport_pages as $page) {
                      if (($page->purchase_date + 30325800 < time()) && ($page->purchase_date + 30412600 > time())) { // between 351 and 352 days
                          wire('log')->save('user_activities', $page->id . ' email reminder sent');
                          // send email
                  }
              }
          }        
          
      }
      The first wire('log') shows up but the second one doesn't (the purchase_date condition is met (as demonstrated by running the code in a template close in time to when the lazycron routine executes)). The error log gives the Uncaught Error shown above. 
      I think this is a beginner's mistake with something obvious being missed and would be grateful for any assistance in fixing it.