Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Roope

  1. OK, fair enough. If I find some more info about this issue I'll post it here but for now I just have put pressure on ISP to update their MySQL.
  2. Sorry about that jQuery.. edited and deleted. That profile exporter issue was just a side note that I noticed when I was trying to solve the main issue: Some images do not end up to database during upload and that's why they dissapear from input field after page save. All images do trasfer to filesystem correctly. So I belive it's a MySQL issue since only setup where I can reproduce this is at PHP 5.3.23 / MySQL 5.0.8 (although tested only couple of different combinations available). I can PM you some login details to live site if you wan't to go explore. That jQuery break notification on firebug probably has nothing to do with this.
  3. OK, so I re-tested this issue on PHP 5.3.23 and mysql 5.0.8 server using both; dev and master branches. On fresh install issue exists with both of them. There is actually Break Notification on page load when image field is attached to it: JSON.parse: unexpected character. But it so it does on local machine also where image upload works as expected.
  4. Thanks for the reply guys! There's only couple of site modules installed that I don't think is doing any harm here (Import Pages from CSV, Email Obfuscation (EMO), Export Site Profile, Video embed for YouTube/Vimeo). I haven't noticed any JS errors or anything. That MySQL error I posted before is the only one. I just intalled site on localhost running PHP 5.4.10 and MySQL 5.5.29 and all images are saved correctly so I think this may have something to do with old MySQL version that hosting company has installed (5.0.8). I do have couple of other sites on that same server though and haven't noticed any problems before. There is no option to choose another version so I can't test it at the moment on live server. I also didn't succeed to install this site from SQL-dump created by Export Site Profile. There was some errors during installation: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name1010' in 'field list' and when I try to enter admin or view any page it just throws: Error: Call to a member function isDefault() on a non-object (line 490 of /Users/Roope/Sites/demo/wire/modules/LanguageSupport/LanguageSupportPageNames.module) Wire folder was fresh copy from dev branch (last update today 02.09.2013)
  5. Hi! I have this annoying problem on one of my clients site using latest dev. When images are uploaded, all of them show up to image field and files are transferred correctly to page folder. After page save some random images disappear from field. Couple of times I received error during upload (page id 1090): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1090-0' for key 1 Though usually there's nothing and no errors show up to log file. I've tried to add files one by one or by dragging several at the time and no difference. Some images get lost in the way. It can be one from two uploaded files or one from eight. File that gets skipped can be uploaded fine next time. PHP version is 5.3.23 and mysql 5.0.8-dev. Memory limit 256M. Any help would be much appreciated!
  6. OK, so I was able to reproduce this scenario: when you use PageTitleLanguage fieldtype with only default language installed, content of the Title field is not editable. Content does not change after page save. Problem is solved when you install more languages to PW. Maybe this thread should be moved to Multi-Language Support forum instead where we can discuss is this even bug since why would you need PageTitleLanguage field with only default language installed. Well, I did so because we will have different languages for the site in the future but first release will be only in finnish.
  7. I have very strange problem on one little multilingual site that has only default language set at the moment. I can only edit Title field of Home page but all others are uneditable. The text that was used on creation rolls back after page save. Title is editable via API though. Site is build on dev branch. Just pulled latest updates but no change. There is only admin hotkeys and emo modules installed (except language support). Default language changed to finnish and here is only error that system throws on page save: Session: Missing required value (_pw_page_name) Could this be some bug on PageTitleLanguage module or is there something obvious I'm just missing again? I have no problems on any other projects developed from same branch.
  8. Thanks Ryan! Man I was struggling with this but once I got the logic everything went smoothly. I totally agree with what you said about arrays in GET vars. Now after form submission they are really ugly since it's submitted as is. Things get better when you move to different pages. Maybe I should send form by jQuery so I could make prettier urls by default or how would you do it? I did GET var whitelisting like this - pretty much as you suggested: <?php // open new instance of our import module since // it holds field names and types we can use for validation $deco = new DecoImport(); // there's some get data if ($input->get->count() > 0) { foreach ($input->get as $key => $value) { // skip undefined fields if (array_key_exists($key, $deco->fieldTypes)) { // skip empty values if (empty($value)) continue; // sanitize key $key = $sanitizer->selectorField($key); // sanitize value if ($deco->fieldTypes[$key] == 'page') { if (is_array($value)) $dirty = $value; else $dirty = explode("|", $value); $value = array(); foreach($dirty as $id) $value[] = (int) $id; // sanitize to INTs $value = implode("|", $value); } else $value = $sanitizer->selectorValue($value); // whitelist data $input->whitelist($key, $value); } } }
  9. Thank you very plenty Ryan! You're absolutely right - I made such a rookie mistake and didn't have page numbers enabled from template setup. Once I did it paging started working like excepted. Sorry about that. Right now I have function that makes selector string for PW from post or get data and I have this excactly problem with PW page field values that it can be either array or string, with values separated by plus sing or empty space. If I just whitelist data like you suggest, I wouldn't have to do all checking and exploding at all. If I got this right.. Will test it later since it's my birthday and midsummer festival here in Finland so God Bless PW and hyvää juhannusta to everybody!
  10. Aah, ok.. now it's looking better. Thanks! Still not there yet.. Now pager url looks like this: http://domain.com/search/?vendor=1087|1212&light_source_amount=&product_family=&safety_class=&voltage=&height_min=&height_max=&length_min=&length_max=&width_min=&width_max=&depth_min=&depth_max=&hanging_height_min=&hanging_height_max=&diameter_min=&diameter_max=&page=2 Notice pipes as vendor delimiters. OK, then I click to page 2 but nothing happens. Same results and pager page 1 is active. Only difference is that now pager urls have changed to use plus sign as delimiter: http://domain.com/search/?vendor=1087+1212&light_source_amount=&product_family=&safety_class=&voltage=&height_min=&height_max=&length_min=&length_max=&width_min=&width_max=&depth_min=&depth_max=&hanging_height_min=&hanging_height_max=&diameter_min=&diameter_max=&page=2 Selector for results remains same all the time: id>1, limit=20, template=product, vendor=1087|1212
  11. Hello guys, need a little help here. I'm also trying to set pager for search results but the whole query string seems to be stripped out in links that pager renders. // page url http://domain.com/search/?vendor[]=1087&vendor[]=1212&light_source_amount=&product_family=&safety_class=&voltage=&height_min=&height_max=&length_min=&length_max=&width_min=&width_max=&depth_min=&depth_max=&hanging_height_min=&hanging_height_max=&diameter_min=&diameter_max= // pager urls http://domain.com/search/?page=2 http://domain.com/search/?page=3 http://domain.com/search/?page=4 Can it be because the query string is so freaking long?
  12. Interesting grids - calculate your own widths.. It's like you would get gun and hunting cap from meat store.
  13. To me, grid has to be cofigurable - otherwise it's probably too limited for everyday use. When I can adjust number of columns, gutters and paddings, I know I can use my grid basicly on every project, no matter who designs it.
  14. I've also been looking to Susy direction but I like to do my preprocessing with php so that it runs on every server. If I need to quickly change some styles on live site I wan't to do it hassle-free. With LESS I use Leafos lessphp - he also has nice SCSS php compiler but it doesn't handle SASS syntax. Leafos lessphp is connected to my assets compiler class that generates minimized js/css files on the fly so it also handles preprocessing while doing it's job. How do you guys work with preprocessors? And does anyone have recomendations for solid php SASS parser?
  15. Can I use Pro Cache in the pages where I need get parameters from url to modify output?
  16. 960.gs was the one that really kicked in then back in the days - for me and many others. I liked it so much that when I decided that we need to build our own fluid grid system, it had to be based on 960 syntax and be fully compatible with ancestor. BFluid was born. Since then it's been my one and only choise for css grid. Why to build own css grid when world is full of them? Simple - they don't bend the way you want. Most are based on fixed column count and don't support gutter + padding in cells. I also hate to have axtra markup for every row or extra class names for first/last items. BFluid is build on LESS so you can create custom grids on the fly. And have as many or as little of columns as you need - with gutter and padding. Nesting, multiple grids, fixed grid, semantic markup - it's all there. All we would need is some spare time to build cool site for it - or at least decent documentation. Maybe this summer..
  17. Congratulations and thubs up for CMS Critic! Site is amazingly fast. Gotta get pro cache immediately.
  18. I think you're right Ryan but maybe logic shoud be coherent all the times when 404 page is rendered. Consider this kind of scenario (that's used in this particular project). You've translated homepage name to match your language setup so every page has language identifier prefixed in url: domain.com/en/products/ domain.com/de/produkte/ domain.com/se/produkter/ Then if you enable url segments in this product template and handle false matches by throw new Wire404Exception(): domain.com/de/produkte/somefalsepath/ // here 404 page is in german when 404 is thrown manually from template domain.com/de/somefalsepath/ // here 404 page is in default language when system throws it It would be more logical if 404 page has same language in both cases.
  19. OK, so maybe I just wrap values manually and forget sanitizer here. Sounds like easiest option. Page field would of course be the best solution for 'socket' but customer wanted text field for some reason so we have to deal with that. There's also lots of overhead when you have to get all data from actual product pages compared to that there would be individual pages for each socket type to be used as Page type 'socket' field.
  20. So basicly we have product pages and this advanced search filters result from them. Product page has many fields in it (like color, material, socket). Most of fileds are Page field type so dealing with this kind of data is no problem. Then there are couple on text fields in product page (like socket) and we need to use data from these text fields also as filter in our advanced search form. Some example data from product pages 'socket' text field: E27 E27+PowerLED GU10 2G11 Then we create checkboxes from this data: <label><input type="checkbox" value="E27" name="socket[]"> E27</label> <label><input type="checkbox" value="E27 PowerLED" name="socket[]"> E27+PowerLED</label> <label><input type="checkbox" value="GU10" name="socket[]"> GU10</label> <label><input type="checkbox" value="2G11" name="socket[]"> 2G11</label> If user would have then selected all these as filter in advanced search form, our selector string would look like this: socket=E27|E27 PowerLED|GU10|2G11 And now you can see that our second socket data fails to match since + sign is removed by sanitizer.
  21. If + sign has no use in PW operators maybe it should be left untouched? There are many cases where input value could have plus sign in it, like phone numbers for example. In my case advanced search form has select options and checkboxes and values come from PW pages. When user changes options, we create selector string from post data and display result count (and finally output results when form submit is clicked). With this text field we basicly get every page that has value in it and strore values to temp array and remove duplicates by array_unique(). Then we create options/checkboxes from this unique data. I don't know any better solution for this.
  22. Is there a reason why plus sing is removed by $sanitizer->selectorValue - I can't see it been used anywhere in the docs? I'm just thinking cause those sanitized text fields actually had + sings and now values don't match.
  23. Ahh.. I didn't know that value can be quoted like that. Works nicely. Thank you very much Wanze - again!
  24. Hello all! I have a little problem with getting find selector to work with site data. My customer needs advanced search form for products where one of desired filter option is getting data from page text field. Problem is that some pages have commas in field value that breaks my selector string. Striping of comma and rest of the string and then use ^= as operator would be one choise but then there are lots of not exaclty matching results that my customer want's to avoid. Another solution would be of course to create pages for actual data and then use Page fields to attach it to product pages. This is how it's done with many other fields on product page but we selected text field for this one because there is actually so many variations and many variations belong only to one product. So is there any handy workaround for this or do we just have to deal with not so precise search results?
  • Create New...