Jump to content

Oliver

Members
  • Posts

    167
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Oliver

  1. I can't wait to finally test it tonight or maybe tomorrow. I'll fork the latest version and dive into it to experiment with some features, as I have also an actual use case in mind. It's a really exciting thought, being able to build online-shops with such a powerful API at hand. Hopefully I'll be able to contribute at least some thoughts and ideas to this.
  2. Soma, that's a nice one! Maybe a possibility to optionally define a function for calculating value range to make the value grow non-linearly as you slide could be a nice enhancement. Could be handled like custom API calls for page ref fields, a field for js code like "return Math.pow({$x})". But that's just an idea.
  3. The module extends Process and Process extends WireData, doesn’t it? Shouldn’t the module inherit the implementation from WireData? EDIT: Ok, I read it slower a second time. I think, you got the problem, you got me! EDIT: It works. Thanks once more, ryan!
  4. You’re a machine, apeisa! Thanks for sharing your insights here. I hope I’ll find the time soon to have a closer look at your code. Especially how you deal with modular payment modules. Have been thinking about this a lot as I’m currently trying to work out a similar solution to handle login modules for signing in users with social networks etc.
  5. Ryan, I love it! Soma, I absolutely get what’s your point. Especially for editors it would be a very comfortable solution to deal with repeatable elements of different templates. Maybe their should be a kind of helper field type, that just allows you to manage a page’s child pages as repeatable elements, so editors don't have to deal with creating child pages manually. Its input field setup in the page edit process would look just like ryan’s here, showing blocks with the child pages’ fields. The editor could choose from the allowed templates for new child pages. And in templates the field would directly provide the page array like in repeatable elements. Of course it just would be a kind of shortcut for stuff that could be done manually already. Right now I’m working on a project, where such a thing would be pretty useful.
  6. While the saveModuleConfigData is called from the install() method of the module, getModuleConfigData is called from a method of another module in a completely different context. And it never happens on a single page view. So I don’t think that’s the problem here. Any other idea? Saving the role’s ID is what I want to happen. I see, I forgot to set it to $this->roles->get('guest')->id. EDIT: I also call saveModuleConfigData from another method somewhere else. Like this: $this->modules->saveModuleConfigData($this->pages->get($this->input->get->id)->process, $config); Data isn’t saved. I double-checked the parameters, process field is correct, $config is an associative array, everything looks fine. So what’s wrong? UDPATE: I actually found out, that it isn’t a problem with saving the data. It’s just not loaded. My module has this data stored in the db: {"user_roles":["37","1008"],"consumer_key":"asdsadsdsad","consumer_secret":"xasdhaduhu"} But the values aren’t accessible via $this->user_roles or $this->consumer_key in the module.
  7. The bug report I found was this one: http://bugs.mysql.com/bug.php?id=28638 But the guys replying say the problem was fixed in version 5.0.41. My host runs 5.0.37-community-nt.
  8. I tried to save some default settings on install this way within the ___install() method of a module: $config = array( 'user_roles' => $this->roles->get('guest') ); $this->modules->saveModuleConfigData($this, $config); When trying to get the config data on module execution, I just got an empty array. Any idea why it shouldn’t work this way? $module = $this->modules->get($module_page->process); $config = $this->modules->getModuleConfigData(get_class($module));
  9. When I for example generate a list of articles, I get my pageArray through the API within another page’s template, iterate through it and call the render method for output. Works great. But what to do if I wanted to make the template of these articles behave in a certain manner depending on the the context (the current page’s template) the render method is called from? Is there a way to access the vars existing within the current page’s template or even the current page’s field values on rendering from the articles’ template? To check “Am I rendered within/from another page’s template?” and “Is the var $xy or the field ‘ab’ set to ‘brabra’ in the other page I’m rendered in/from?”
  10. One thing I’m thinking about again and again is, how the products could be dealt with after being put into the cart or being part of an order. The product within the catalog could be considered a kind of mask providing all possible variations. Whereas the product in the basket is the final result of selections made by the customer. So should a selected product be saved as a page with a certain template providing a page ref field to the products original page, a text field for saving the selected values maybe json-encoded and a field for quantity? How to keep the data, the archive of orders and ordered products consistent, when the product data could be changed after having already been sold before? Ideas?
  11. Ryan, just to give you an update: It’s actually a bug in this particular mysql server version which is about 5 years old. I found a bug report that describes my problem and it seems there is a problem with primary keys using a varchar field and caching. I asked the hosting provider to update the server.
  12. As I’m getting a bit more into the e-commerce idea I was talking about in one of the other threads, I have been thinking about the PW template system. In a shop system you’d need a kind of basic product template with certain necessary fields like default price or something like that. But you’d also need the possibility to have variations of a product template, where additional fields can be defined individually for a certain kind of product. I know that there is the possibility to clone fields from an existing template. But I don’t think, that is a good solution for this particular problem, as you were able to delete some of the basic product data fields. So my thought was, that it maybe would be a cool thing to be able to define a kind of relationship between templates. Like a class extending another one you could define an existing template as parent and the child template would inherit all fields and settings. New fields could be added, the inherited fields were kind of protected, the settings could be overridden by the ones defined for the child templates. I guess, this could be achieved by a module pretty easily. But I think it could also be a pretty nice enhancement as a core feature.
  13. Yeah, I should run a database repair! Having value a saved in the db, inserting/updating to value b and after that running the SELECT query results in getting a much older value c, while browsing the table still gives me value a. WTF? Update: Ok, it’s totally corrupted, the whole thing! Repairing fixes the issue for the moment (so it at least shows the values I updated to before), but the db keeps behaving the same way after that, showing different results for different queries getting the same field value. As there is just one line in the table, I’m pretty sure, it’s the same field. Seems I’ve to contact the hoster to get this fixed. Update 2: As it seems, the problem just appears when using INSERT INTO ON DUPLICATE KEY UPDATE queries. An UPDATE query updates successfully and the field shows the right result.
  14. A problem has come up, when I uploaded PW2.2 to a client’s webspace. Everything seems to work fine but one thing: When editing for example the value of a page’s text area, the value which was initially - and successfully - entered and saved, can’t be overwritten by a new value. As I know it worked on my local web server and on other webspaces, I tried to get to the problem’s root. The SQL-query generated to update the field is INSERT INTO `field_team_text` (pages_id, data) VALUES('1074', '11112asdsadasdasa') ON DUPLICATE KEY UPDATE data=VALUES(data) I tested it in phpMyAdmin directly on the database used for the PW2.2 setup. The result is, that the query doesn’t cause any error but also doesn’t update the `data` column for the already existing `pages_id`. As `pages_id` is correctly defined as primary key, I can’t see any reason why this shouldn’t work. The server version is 5.0.37-community-nt, the os may possibly be Windows, as the web server (which isn’t running on the same machine like the database server) definitely is running it. Any ideas?
  15. Soma, apeisa, I absolutely agree. Single and specific modules with hookable methods for each functionality to be combined and used the way the dev wants to in combination with templates would be my choice. This would allow us to more easily extend the functionality individually for each project when necessary. And it could make the whole thing much more powerful. So a project plan would be great. Soma’s idea with the PW install and shop repository sounds good.
  16. Really strange thing. I tried again and this time it behaved the way I originally expected it to do. So, no idea what this temporary error caused. Anyway, it’s gone.
  17. Yeah, I’ve been dealing with a xtc:commerce (a osCommerce fork) and it’s a incredible mess, too. Every “module” you want to implement needs you to change stuff in core files. But at least I got a good impression of the complexity of a shop system and how the different features influence - or corrupt - each other. I’m definitely no ecommerce expert either. Nor am I a really good coder, rather a hobbyist. But I’ll spend some thoughts on this as I have a project coming up that could be a opportunity to experiment with several ideas. apeisa, I’d love to learn more about your shopping cart and order management. Maybe you’ll find the time to put your approach into a few words?
  18. Lately I’ve been building a little script for a local journalist who manages a open Google Docs spreadsheet where Swiss journalists can enter there social media data like Twitter names etc. The script updates a Twitter list with the collected Twitter names in the spreadsheet, means it gets the document feed through Google Docs API and updates the list through Twitter API. Long story short I’ve been dealing with the oauth authentication mechanism. I started thinking about creating a module for PW to connect user accounts with oauth providers like Twitter. Could be helpful in more community focussed projects.
  19. As PW is a perfect fit for any kind of product catalog, I’d love to keep the discussion going on how the several “challenges” could be overcome and the needed functionalities could be implemented through separate modules to make a 100% module based PW commerce solution possible. There are things like shopping cart, order management, stock management, checkout and payment and - as you already said - product variations to deal with. I think with a clever architecture these things could be solved and built in a very modular and easily extendable way. Would love to hear your ideas here. And maybe apeisa also has already more practical experience to share on this?
  20. I mentioned in my multi-language post that I was thinking about writing a MODx like «context» module to create and manage multiple page trees (each as a separate «context». On access one of the context would be selected for content delivery depending on several parameters like language or for example the domain the page is accessed through. In the settings of each context - similar to a .htaccess mod_rewrite condition - a regexp could be provided to determine the right page tree to be used. So the matching context’s home page would be served. I’m not sure, if this would be a possible solution for the problem discussed here?
  21. Got a little TinyMCE issue here: The editor creates paragraphs when text is entered. But as soon as the content has been saved and is loaded again into the editor, all the paragraph separations within the root block <p></p> are converted to <br /> breaks. I had a look into the module settings in InputfieldTinyMCE.js and it seems there is no obvious reason why the line breaks are converted. I didn’t experience this problem before the update to PW2.2. Has anything been changed in the module lately?
  22. Once more you gave me the right hint. Didn’t know about the URL segments thing. Thanks!
  23. I have a serious problem with understanding the process field and how the process catches actions like "add" or "edit" from the url path (e.g. …languages/add/, languages/edit?id=xy) to execute the right method (executeAdd() etc.). I’m currently working on a more comfortable solution for select fields with preset options. For each select field created through setup/field/ a child page is created below having the name of the field. The child page’s template has a process field set to call a process extending ProcessPageType like it's the case with setup/languages/. Each option of the select field will be stored as an own page with title and a value field as a child of the select field page. Now I want to act the whole thing like the language admin interface. I got the list rendering working on setup/field/select_field_name/ but I get a 'Page Not Found' on calling setup/field/select_field_name/add/ as well on calling edit?id=xy. Any hints? Thanks in advance.
  24. Just another thing I stumbled upon: In the admin area you get the same view under /processwire/page/ as under /processwire/page/list/. But while on /processwire/page/ the translations of the admin default template replace the original text, on /processwire/page/list/ the template translation is still used, but the page title »Page List« is still in English and isn’t listed for translation in LanguageTranslator anywhere. Neither in wire--templates-admin--default-php.json, nor in wire--modules--process--processpagelist--processpagelist-module.json. Same thing with the titles of the html document. Having a look at the corresponding code sections in the admin template <title><?php echo __(strip_tags($page->get("browser_title|headline|title|name")), __FILE__); ?> • ProcessWire</title> … <h1 id='title'><?php echo __(strip_tags($this->fuel->processHeadline ? $this->fuel->processHeadline : $page->get("title|name")), __FILE__); ?></h1> it seems to me that they are meant to be translatable. Right?
  25. Nothing to be sorry about. Thanks ryan.
×
×
  • Create New...