Jump to content

Ovi

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by Ovi

  1. The solution is here: https://processwire.com/talk/topic/12375-urgent-will-pay-help-debugging-image-fields/
  2. I love you man! I've been waiting for something like this for soooo long. My clients are going to love this. I found a CSS bug by the way. In PixlrEditor.css you should change: .pixlr-menu-bar{ position: absolute; top: 1em; right: 1em; background: transparent; } to: .pixlr-menu-bar{ position: absolute; top: 1em; right: 1em; background: transparent; z-index:9999; } This prevents the button from being un-clickable because it sits underneath the image thumbnail on the back-end of the page. Great work and thanks again!
  3. Hi Apeisa, I've found a bug. When using a cropimage field inside of a repeater field, the description of the image does not save. The puzzling part is that I think it used to at some point, since I have images with descriptions still there in the install. But now I've run into this problem on any install I try (they are all on the same server and I haven't changed the server config). I tried a fresh install of 2.5.2.8 and 2.5.2.9 (dev), as well as 2.5.3 (master) and it also happens on 2.3.0. The bug happens with even just the default install and the Thumbnails modules installed, nothing else, on a clean install. Debug mode is enabled but shows no errors or warnings. Console is clean. Normal image fields' descriptions still do save, but if I switch them to CropImage they stop working. I can give you access to an account on the server if you can't reproduce the bug for some reason, just let me know. Thanks!
  4. Yes, seriously unfortunately I am working on just such a site right now. It's for a business that has 10 separate locations (pseudo-franchises, which are more or less independent) and they will all need to have their own separate blogs with their own URLs and their own tags, categories and archives. So far I've used a method where all the blogs have different templates in PW which all point to the same template file (which is based on Ryan's blog profile) but I've made the template file dynamic so the names of all the fields are built at run-time based on a naming convention. For example: tags-location1-name, tags-location2-name... etc. instead of just having 1 tags field. And all those suffixes are stored in a special hidden field in the root page of each location. Don't mean to derail this thread, just wanted to point out a situation where more than 1 individual blog is needed and how much work it can take to set up something like that. Again, big thanks for your work, it's going to save me a lot of time on many projects!
  5. Awesome work! Now, what if i needed to have 10 separate blogs like this on the same site?
  6. OMG. Found the error! This needs to be a cautionary tale to others. I had this code in the head section: <?php if ($page->template = "typical-day"): ?> <!-- some files get added here--> <?php endif ?> As you can see there is a "=" sorely missing there (i miss-typed or was just tired, have no clue how it happened). So it ended up changing the template of the page instead of just checking if it was set to "typical day". The "typical-day" template obviously did not even have the "homepage_slideshow" field assigned to it. On the bright side That is something very cool to be able to do (changing the template on run-time), which might have some interesting applications. Is that something one should do or should we stay away from it?
  7. This is driving me nuts. It's such a simple thing, I've done it 100s of times before, but right now it's not working. It's either: an obvious mistake on my part Processwire broke (hope not) I'm trying to do the simplest thing: list the images in an image field, like this: <?php if (count($page->homepage_slideshow)): ?> <ul class="campHpSlideshow"> <?php foreach ($page->homepage_slideshow as $slide): ?> <li><img src="<?= $slide->url ?>" alt="<?= $slide->description?>"></li> <?php endforeach ?> </ul> <!-- /.homepageSlideshow --> <?php else: ?> <img src="http://placehold.it/1024x400&text=no+images" alt=""> <?php endif ?> The count($page->homepage_slideshow) returns false, even though there are images in the field. The field name is spelled correctly. I triple-checked. Also, I could swear this was working before. Any ideas what I can do to fix this? Would re-installing help?
  8. Figured it out finally: Servint bungled things up and installed APC and Eaccelerator together No wonder things got screwy. Thanks for all your help Ryan, you rock.
  9. Yep I'm running on DSO right now, but the issue's still there... Working with Servint support but it's an uphill battle.
  10. Did just that, wiped the wire directory, re-uploaded from a freshly downloaded copy of PW 2.3.0 - still the same behavior. All the sites on that server have this problem. Maybe the switch from suPHP to FastCGI caused this? That was my best guess. So i asked Servint to switch to DSO - which should be what you're using too, Ryan, since you told me in another thread that you're not using FastCGI, and DSO is the only other alternative that allows APC. Still no luck, even with DSO (i of course i changed the attributes of the /site/assets/) folder to 777 to account for PHP running as 'nobody" - but the error still appears after creating an image field. My sites are so much faster with APC though, and i really don't want to go back to suPHP. I even did a fresh install of PW on a new account on the server, and i still get this issue appearing. That's just weird. Maybe there's some obscure stuff in my server config that Servint screwed up...
  11. Hi Ryan and thanks for your help! I cleared the APC cache (even put <?php apc_clear_cache(); ?> in the header of the site, with no conditions, to make sure it clears. The fields did start working once i manually created the missing table, but each time i create a new image field, it get the error again. For some reason the table for that field never gets created, and i get this error when trying to create a new field: Error: Uncaught exception 'WireDatabaseException' with message 'Table 'dap_pw.field_testimage3' doesn't exist' in /home/dap/public_html/wire/core/Database.php:118 Stack trace: #0 /home/dap/public_html/wire/modules/Fieldtype/FieldtypeFile.module(261): Database->query('SHOW COLUMNS FR...') #1 /home/dap/public_html/wire/core/Fieldtype.php(321): FieldtypeFile->getDatabaseSchema(Object(Field)) #2 [internal function]: Fieldtype->___createField(Object(Field)) #3 /home/dap/public_html/wire/core/Wire.php(271): call_user_func_array(Array, Array) #4 /home/dap/public_html/wire/core/Wire.php(229): Wire->runHooks('createField', Array) #5 /home/dap/public_html/wire/core/Fields.php(203): Wire->__call('createField', Array) #6 /home/dap/public_html/wire/core/Fields.php(203): FieldtypeCropImage->createField(Object(Field)) #7 [internal function]: Fields->___save(Object(Field)) #8 /home/dap/public_html/wire/core/Wire.php(271): call_user_func_array(Array, Array) #9 /home/dap/public_html/wire/core/Wire.php(229): Wire->runHooks('save', Arr (line 118 of /home/dap/public_html/wire/core/Database.php) This error message was shown because you are logged in as a Superuser. Error has been logged. So far it only happens with image fields.
  12. What i get is this error message, whenever i create a new image field, on a page with the URL sitename.com/processwire/setup/field/save Error: Uncaught exception 'WireDatabaseException' with message 'Table 'dap_pw.field_testimage' doesn't exist' in /home/dap/public_html/wire/core/Database.php:118 Stack trace: #0 /home/dap/public_html/wire/modules/Fieldtype/FieldtypeFile.module(261): Database->query('SHOW COLUMNS FR...') #1 /home/dap/public_html/wire/core/Fieldtype.php(321): FieldtypeFile->getDatabaseSchema(Object(Field)) #2 [internal function]: Fieldtype->___createField(Object(Field)) #3 /home/dap/public_html/wire/core/Wire.php(271): call_user_func_array(Array, Array) #4 /home/dap/public_html/wire/core/Wire.php(229): Wire->runHooks('createField', Array) #5 /home/dap/public_html/wire/core/Fields.php(203): Wire->__call('createField', Array) #6 /home/dap/public_html/wire/core/Fields.php(203): FieldtypeImage->createField(Object(Field)) #7 [internal function]: Fields->___save(Object(Field)) #8 /home/dap/public_html/wire/core/Wire.php(271): call_user_func_array(Array, Array) #9 /home/dap/public_html/wire/core/Wire.php(229): Wire->runHooks('save', Array) # (line 118 of /home/dap/public_html/wire/core/Database.php) This error message was shown because you are logged in as a Superuser. Error has been logged. However, the field does get created, and i can use it, and i can save any configurations i make, but i can't rename or delete it (i get the same type of database error message). This started happening after asking the Servint support team that manages my VPS to install APC and PDO on my server. Any ideas how these things can be related, or what can i do to fix this? Thanks, Ovi EDIT: Now i'm seeing that when trying to create a new page that uses an image field i get this error: Error: Uncaught exception 'WireDatabaseException' with message 'Table 'dap_pw.field_event_image' doesn't exist' in /home/dap/public_html/wire/core/Database.php:118 Stack trace: #0 /home/dap/public_html/wire/modules/Fieldtype/FieldtypeFile.module(261): Database->query('SHOW COLUMNS FR...') #1 /home/dap/public_html/wire/core/Fieldtype.php(460): FieldtypeFile->getDatabaseSchema(Object(Field)) #2 /home/dap/public_html/wire/core/Fieldtype.php(415): Fieldtype->getLoadQuery(Object(Field), Object(DatabaseQuerySelect)) #3 [internal function]: Fieldtype->___loadPageField(Object(Page), Object(Field)) #4 /home/dap/public_html/wire/core/Wire.php(271): call_user_func_array(Array, Array) #5 /home/dap/public_html/wire/core/Wire.php(229): Wire->runHooks('loadPageField', Array) #6 /home/dap/public_html/wire/core/Page.php(651): Wire->__call('loadPageField', Array) #7 /home/dap/public_html/wire/core/Page.php(651): FieldtypeCropImage->loadPageField(Object(Page), Object(Field)) #8 /home/dap/public_html/wire/core/Page.php(558): Page->getF (line 118 of /home/dap/public_html/wire/core/Database.php) This error message was shown because you are logged in as a Superuser. Error has been logged.
  13. Thanks Ryan, I just realized i was using suPHP as a PHP handler, and so eaccelerator wasn't even working. I did some reading and i just put in a ticket to Servint to switch to FastCGI and install APC. Are you using FastCGI as well?
  14. Hi everyone, I'm currently wondering what would be an optimal configuration to use on a VPS or dedicated server running Processwire. I'm referring to configuring Apache and PHP so that they offer the best environment for running Processwire with best performance while keeping the security as tight as reasonably possible. I hope we can make a guide out of this for people like me who are not server administration veterans and just know how to compile Apache using EasyApache and tweak the PHP settings in WHM. I'll take care of writing out the guide if you guys can supply the info. I'm obviously hoping that the man himself Ryan will pitch in and help out with this. Thanks in advance you awesome people!
  15. It's working! I was missing $page->setOutputFormatting(false); and $page->save(); Working module: <?php class PageAverageRating extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Copy average rating into hidden field', 'version' => 100, 'summary' => 'Copies the average rating to another field', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHookAfter("CommentFormWithRatings::processRatingInput", $this, 'copyAverageRating'); } public function copyAverageRating() { $page = wire('page'); // get access to the page $page->setOutputFormatting(false); // without this we can't save the page later on // we're interested in product pages only: if($page->template->name != 'product') return; // use the existing averageRating method to get the average rating and store it in the field // we created called average_rating: $page->average_rating = $page->product_comments->averageRating; $page->save(); } } Many thanks Antti, Soma and of course Ryan, you guys rock. This is finally starting to make sense for me. I think i will write a guide to help people like me get started with module development.
  16. So what i have now is this: <?php class PageAverageRating extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Copy average rating into hidden field', 'version' => 100, 'summary' => 'Copies the average rating to another field', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHookAfter("CommentFormWithRatings::processRatingInput", $this, 'copyAverageRating'); } public function copyAverageRating() { $page = wire('page'); $page->average_rating = $page->product_comments->averageRating; } } Still no dice. Don't get any errors either.
  17. Hi everyone, I'm back on this project after it got put on the backburner for a while and so i'll need to get this working. Thanks for your awesome support so far! What Ryan is saying here is very true, since i get the error: Undefined offset: 0 in /public_html/site/modules/PageAverageRating.module on line 24 With line 24 being of course, just like Ryan says: $page = $event->arguments[0]; The reason "$event" is there is that i just copy-pasted stuff from HelloWorld.module and tried to make it work. Obviously the $event argument is passed by all the methods that are being hooked in the examples given in the HelloWord.module file, but not by the method i'm hooking into. So now that the hook works, i just need a way to access the current page and all its attributes. Can anybody suggest a simple (as possible) way i can achieve that? Thanks so much as always.
  18. Wow, I don't know what's went on there. i'm seeing the same thing now. I'm sorry for all the trouble i put you through, it definitely wasn't working for me before - the full page was getting displayed. I'll move on to seeing why the field isn't getting populated. Will keep you posted. Thanks so much!
  19. Hello guys, I apologize for not responding for a while, i was ( still am ) in a middle of a nightmare situation with one of my older clients and his MODx site, i barely had time to sleep. So happy i moved away from MODx, wish i'd found PW earlier. Your offer is very generous Soma, of course i'll give you access! I will PM you right now with the login details for the site and also the FTP to it. Thanks so much, Ovi PS: the fact that you haven't given up on me and my problem yet shows what an awesome community this is. Best one i've seen so far.
  20. Thanks for the suggestions Ryan, but none of them helped, unfortunately. 1. i do not use opcode cache on that server 2. i cleared the modules cache - no dice 3. the comment field was never set to redirect 4. I'm afraid to upgrade to 2.3.1 straight off the bat for fear of creating more bugs, i have to create a copy of the site on another account and try it there. Will let you know how it goes. 5. i uninstalled and reinstalled the module - no improvement. Not to whine, but I'm really getting to the end of my rope here, i have to turn in the site soon and this is holding things up terribly. Any help would be appreciated, although i'm beginning to think this can't be fixed for my site.
  21. Yep that works, if i use that hook the function gets called. I'm using PHP 5.3.23 and PW 2.3.0
  22. Nope i had autoload in the first time i installed the module.
  23. I have cache set to 0 on the product template. not using any other caching method. The comments module and the ratings module are working fine. I can add comments and ratings and the they get displayed properly. Everything is perfect except this hook won't work. I'm really starting to think we've stumbled onto some weird PW bug here. But maybe i'm jumping to conclusions...
  24. sure: <?php class PageAverageRating extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Copy average rating into hidden field', 'version' => 100, 'summary' => 'Copies the average rating to another field', 'singular' => true, 'autoload' => true, ); } public function init() { die("foo"); $this->addHookAfter("CommentFormWithRatings::processRatingInput", $this, 'copyAverageRating'); } public function copyAverageRating($event) { die("foo"); $page = $event->arguments[0]; // we're interested in product pages only if($page->template->name != 'product') return; // copy the average rating into a field called average_rating $page->average_rating = $page->product_comments->averageRating; } }
  25. It is definitely autoload: public static function getModuleInfo() { return array( 'title' => 'Copy average rating into hidden field', 'version' => 100, 'summary' => 'Copies the average rating to another field', 'singular' => true, 'autoload' => true, ); }
×
×
  • Create New...