Jump to content

MECU

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by MECU

  1. Turns out it was a collision between Laravel and PW sessions. Once I removed the Laravel Session provider and alias in /laravel/app/config/app.php it worked great. I also removed the Auth provider and alias. Not sure if that is also needed to be removed with Session. I didn't test enough to determine that. If the above alone doesn't work, then also remove the Auth and it should work. Here's everything I commented out to get it to work: //'Illuminate\Auth\AuthServiceProvider', //'Illuminate\Session\CommandsServiceProvider', //'Auth' => 'Illuminate\Support\Facades\Auth', //'Session' => 'Illuminate\Support\Facades\Session', There's also this: 'Illuminate\Session\SessionServiceProvider', But commenting that out caused Laraval to crash in wanting session help.
  2. Seems like one should be able to modify the created and modified properties (correct term?). I created a field for date and then was able to move this field over to the posts so it would be easier to manage with new posts as well with: update pages,field_date set pages.created=field_date.data where pages.id=field_date.pages_id Since I'm only doing a one-time import, I can now delete the date field.
  3. It seems I've included ProcessWire correctly, as I can access the API, but the fact that I'm logged is does not register correctly. According to the Include & Bootstrap page, all I need to do is include this in Laravel and I'm done: require($app['path.base'].'/public/pages/index.php'); It seems I need to actually process whether a user is logged in? Does the fact that I have it installed in a /pages subdirectory matter? I deleted all cookies and tried again and it didn't matter. The cookies don't have a directory
  4. I'm having trouble with dates coming over properly. All the dates are getting set to the current time of import, which is obviously not useful.On line 53 of the revised code, you have: $post->date = $row['post_date']; But I don't see the date method in the $page documentation. I tried: $post->created = strtotime($row['post_date']); $post->modified = strtotime($row['post_modified']); But with the same results. Any suggestions? Also, for others attempting this, I encountered this tidbit that may be useful to you: The SQL to get the data starts: SELECT * FROM wp_posts But I had modified my WordPress table definition prefix for security reasons (like everyone should have), so I had to change wp_posts to wp_xxx_posts That threw me for half an hour.
  5. I have PW installed in subdirectory /pages. This makes all my pages load with URLs like /pages/{slug} which is what I want as I'm only using PW as the CMS for static pages and articles. However I would like the /pages/ url to be redirected to / of the site. I've tried this in the .htaccess file: # Redirect /pages to / RewriteRule ^pages/$ / [L,R=301] right after this: # ----------------------------------------------------------------------------------------------- # Ensure that the URL follows the name-format specification required by ProcessWire # ----------------------------------------------------------------------------------------------- RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$" I did mod the .htaccess in the /pages directory. I also tried the .htaccess in the public directory. I also tried: RewriteRule ^pages$ / [L,R=301] RewriteRule ^(pages/)$ / [L,R=301] RewriteRule ^(pages)/$ / [L,R=301] RewriteRule ^(pages)$ / [L,R=301] Any suggestions?
  6. Although in the forum topic I did use the capitol I, in the code it is lower case i and has the ().
  7. I am solely using non-www on the site.
  8. I'm incorporating PW into a Laravel site layout. For the Login/Logout links, I have: <?php if ( !wire('user')->isGuest() && wire('user')->id && wire("user")->isLoggedin() ) { echo '<li><a href="/pages/control/">Admin</li> <li><a href="/pages/control/login/logout/">Logout</li>'; } else echo '<li><a href="/pages/control/login/">Login</li>'; ?> I started with just wire('user')->isLoggedin(), and that didn't seem to work, so searching around the forums added in the other items. Basically, whether I'm logged in or not, I always see a Login link. If I dd/datadump (a Laravel function) the wire('user') I get what looks like the PW user class. So I've included the PW index.php correctly into my Laravel bootstrap/start.php. As an aside, $wire->user->isLoggedIn() doesn't work. It's probably some conflict with Laravel. Switching to use wire('user')->isLoggedIn() let me work, though it gives the wrong result. EDIT 1: It works fine on the pages that are pure PW, just not any that are Laravel driven.
×
×
  • Create New...