Tagged: 

Viewing 16 reply threads
  • Author
    Posts
    • #1332
      Jason
      Keymaster

      It would be extremely useful if the add-on demo could be enabled while working on a theme. If I add the /theme/piklist directory while the demo is enabled it breaks everything piklist related. I have a feeling this is a known issue, but I wanted to put a vote for having these work together. As I’m working to get familiar with Piklist the demo is very useful, and having to disable it in order to see how my own work is coming along makes it considerably more difficult.

      Thanks!

    • #1334
      Steve
      Keymaster

      @jason– Can you be a bit for specific? or send us the code you are using in your theme? Piklist should not break if Demos are activated and you are using Piklist in your theme.

    • #1337
      Jason
      Keymaster

      Hmm… You’re right. There is something else going on here. I disabled the demo and when I look at the post type I made, there’s two errors on the right:

      Error #1
      Error #2

      Any idea what this is about?

    • #1338
      Jason
      Keymaster

      Just realized I didn’t add the screenshot links. They’re now in the previous post. I just wrote this to update the freshness. ๐Ÿ™‚

    • #1339
      Marcus
      Member

      Jason, it probably has to do with the fact your on a windows machine like me.

      Try this if you’re willing.
      In class-piklist.php file in the includes directory of piklist, edit line 144 which is part of the add_plugin function:

      Change this line:

          self::$paths[$type] = $path;
      

      To this:

          self::$paths[$type] = (stristr($path, ':\\') || stristr($path, ':/'))?str_ireplace('/', '\\', $path):$path;
      

      And see if that takes care of it.
      I haven’t played around with 0.90 just yet, as I tend to devote a lot of time to it each time a new release comes out, but I do remember this error from an old piklist install.

      I hope this works for you.

      Marcus

    • #1340
      Jason
      Keymaster

      Hey Marcus!

      It definitely has to do with Windows being stupid. It appears to be permissions issues, but putting everything to max permissions does absolutely nothing. This is very frustrating.

      Thanks for the line of code, but unfortunately it didn’t fix the problem. ๐Ÿ™

      This work on my colleague’s mac and on the server, but I really need this to work locally.

    • #1342
      Jason
      Keymaster

      This is a serious show stopper for me. Can anyone from Piklist please chime in on this? I’m spending a lot of time trying to figure this problem out. I’d really like to use this framework.

      I know it’s in beta. Should I just assume it’s not ready?

    • #1353
      Marcus
      Member

      Jason, try a couple of these things, as I’ve got a local WAMP development and I got mine working.

      Make sure of your pathing first of all.
      Put piklist as a plugin in the plugins directory, and activate it.
      Any meta boxes go in your theme directory, under piklist/parts/meta-boxes

      In the piklist file includes/class-piklist.php find the lines that say:

      if (isset(self::$paths['theme']))
       {
       if (file_exists(self::$paths['theme'] . $_part))
         {
         $_file = self::$paths['theme'] . $_part;
         }
       }
      

      And replace them with this:

      if (isset(self::$paths['theme']))
       {
       if (stristr($_part, ':\\') || stristr($_part, ':/') || stristr(self::$paths['theme'], ':\\') || stristr(self::$paths['theme'], ':/')) 
         {
         $together = (stristr($_part, ':\\') || stristr($_part, ':/') )?$_part:str_replace('/piklist','',self::$paths['theme']).'/' . $_part;
         } else {
         $together = self::$paths['theme'].$_part;
         }
       if (file_exists($together))
         {
         $_file = $together;
         }
      }
      

      Try that and see if you solve it.

      Marcus

    • #1356
      Jason
      Keymaster

      Hi Marcus,

      I really appreciate your help. Unfortunately, I’m not able to find anything in class-piklist.php that has self::$paths[‘theme’] anywhere in the file. I’m finding self::$paths[‘piklist’], but not self::$paths[‘theme’]. Are you you using 0.9.1?

      Thanks!

    • #1357
      Jason
      Keymaster

      Ah, ok, they changed from the hardcoded, ‘theme’, to a private variable $_theme.

      Unfortunately, this didn’t fix my issue. I’m still told I have permission issues on the line:
      include $_file

      I’ve gone against my better judgement, though, and have completely opened all permissions on every file/directory in the path C:\wamp\www\papertower\dhae\wordpress. I’ve also read, while searching around for this, that the permissions error is often a red herring for another error in the code.

      To be completely explicit:

      • I’m running wamp 2.4 on Windows 8.1
      • I have Piklist 0.9.0 active as a plugin
      • The problem only occurs when I add the /piklist directory to /themes/custom/
      • Error #1: Warning: include(C:\wamp\www\papertower\dhae\wordpress\wp-content\themes\custom): failed to open stream: Permission denied in C:\wamp\www\papertower\dhae\wordpress\wp-content\plugins\piklist\includes\class-piklist.php on line 283
      • Error #2: Warning: include(): Failed opening ‘C:\wamp\www\papertower\dhae\wordpress/wp-content/themes/custom/’ for inclusion (include_path=’.;C:\php\pear’) in C:\wamp\www\papertower\dhae\wordpress\wp-content\plugins\piklist\includes\class-piklist.php on line 283
      • What really puzzles me about the last error is that I don’t have a C:\php directory. I did once, but I got rid of it since wamp has it. I did remove it from PATH.
      • #1358
        Marcus
        Member

        Sorry Jason, my fix was for 0.8 not 0.9
        I figured you must be having the same problem I did, as you have a very similar setup and thats how I fixed mine.

        I still believe it comes back the $_theme variable as I can see you’ve got mixed / and \ in your paths.
        Which is what is stopping you from piklist seeing valid theme paths.
        When I rip 0.9.1 apart (its been a long week) I’ll look at that specific issue and see if I can fix it.

        If you get to it before I do, then please post your results. ๐Ÿ™‚

        Thanks Jason.

        Marcus

    • #1359
      Jason
      Keymaster

      Gotcha. I was under the impression that windows permitted paths with mixed dashes. Not, of course, in command prompt, but something between apache and php in windows. I barked up that tree in the past with another project and found it was a red herring.

      If I happen to get it working on 0.9.1 I’ll be sure to post it. Thanks!

      ~Jason

    • #1374
      vslijkerman
      Member

      I have similar problems on localhost, Error #1 and Error #2 specified above by Jason.
      On my live site, there’s no problem at all.

      Is there any way to get Piklist working in a local environment?

    • #1376
      Jason
      Keymaster

      To be perfectly honest, the issue ended up being the straw that broken the camel’s back of Windows for me. This in addition to cygwin and other nonsense tipped me over. I’ve since then split the partition and installed Ubuntu and now use Linux as my primary work OS. Now Piklist is working perfectly fine locally.

      Still, this seems like enough of an issue that Piklist really ought to look into it themselves. I suspect this issue does pop up on Windows servers.

    • #1390
      Kevin
      Keymaster

      Jason-

      Agreed, I am waiting on a windows machine to do just that with… we love macs here at Piklist ๐Ÿ™‚

      Thanks

      Kevin

    • #1393
      Jason
      Keymaster

      I hear you, Kevin. I’m the only person not working from a Mac in my company. I was going to get one after all this.. but I don’t want to drop $1500. So I switched to Ubuntu instead. It’s really the unix core I’m after anyway. ๐Ÿ™‚

    • #1405
      Marcus
      Member

      FIXED IT!!!!

      The day has come and I’m loving the new piklist. I was just waiting until I had some free time (or rather some extra time) to sit and dwell with the new piklist. And I love it.

      Most importantly I got it working on Windows Jason. (man I hate windows, microshaft kills me)

      includes/class-piklist.php

      Same fix as the first part I suggested Jason:

      
        public static function add_plugin($type, $path)
        {
          self::$paths[$type] = (stristr($path, ':\\') || stristr($path, ':/'))?str_ireplace('/', '\\', $path):$path;  // EDIT MARCUS EBY
          $path = str_replace(chr(92), '/', $path);
      

      But a little below that is the render function and these lines:

      
      foreach (self::$paths as $_display => $_path)
       {
       $_file = (path_is_absolute($view) ? $view : self::$paths[$_display] . $_path_seperator . 'parts' . $_path_seperator . $view) . (strstr($view, '.php') ? '' : '.php');
      

      Just add the following right after:

      
      foreach (self::$paths as $_display => $_path)
       {
       $_file = (path_is_absolute($view) ? $view : self::$paths[$_display] . $_path_seperator . 'parts' . $_path_seperator . $view) . (strstr($view, '.php') ? '' : '.php');
       $_file = (stristr($_file, ':\\') || stristr($_file, ':/'))?str_ireplace('\\', '/', $_file):$_file;  // EDIT MARCUS EBY
      

      If you notice the search and replace is almost identical to the first, except for one small difference. This replaces the ‘\’ with a ‘/’ and the first one replaced the ‘/’ with a ‘\’ (go figure, stupid windows)

      (please don’t add the EDIT MARCUS EBY, I just do that for grep searches. So I know I’ve hacked Kevin’s masterpiece of coding)

      Voila, it shall work in windows. ๐Ÿ™‚

      Hope that fills a need for anyone else out there looking for a windows solution.

      Marcus

    • #1408
      Marcus
      Member

      Turns out more needed to be fixed, and it conflicts with what I posted here.

      Put the new code on Gist:
      https://gist.github.com/anonymous/9016756

      And commented on the four lines I changed at the bottom of the gist.

      Marcus

Viewing 16 reply threads
  • You must be logged in to reply to this topic.