-
Posts
17,231 -
Joined
-
Days Won
1,699
Everything posted by ryan
-
This type of error can usually be resolved by doing this: rm /site/assets/cache/Modules* This is something that ProcessWire does internally when it detects an upgrade. So you may be able to resolve it just by hitting reload on the page once or twice too.
-
Pete, you can replace your find()->count() lines with just count(), which would be a little more efficient, i.e. $count += wire('pages')->count("authors=" . $u . ", include=all");
-
I removed the joke links, so they shouldn't be there anymore. Is anyone seeing any more links? Matthew, in your Firefox go to Preferences > General > Manage Addons. Personally, I disable all addons in Firefox. Then in the left menu, click "Extensions". Look for anything you don't recognize or don't need and disable it.
-
No that stuff is real. I go to that page on Amazon whenever I need a good laugh. Read a few of the reviews and you will fall out of your chair laughing. It is a real product, basically today's equivalent of a stink bomb prank, but apparently much stronger. I don't see those script tags on any of our sites. Anybody else? I think they are getting dynamically inserted by a browser extension. Have you tried another browser?
-
Matthew, regarding the Happy New Year links: I thought that either you were kidding, or you weren't and could use a laugh. So I manually linked them myself, just for fun. I did a search for "worst designed websites ever" and used those for the links. Sorry guys, my sense of humor sometimes gets the best of me. I'll unlink them. With a clearer head this morning, it seems clear that you really are seeing actual spam links and you aren't kidding? It really does sound like browser spyware to me. Also, you mentioned this Skimresources thing, which I'm not familiar with. Can you explain more about where you are seeing this? We are not using any affiliate networks or advertising here, so this is not coming from processwire.com (unless there's some problem with IP.Board). I'm guessing you've got a browser extension that is inserting <script> tags into sites that you visit to automatically link words. Can you try from another browser to double check? For instance, if in Chrome, try Firefox, etc.
-
The ProcessWire 2.3 installer now lets you set the admin URL as part of the install process.
-
This should now be fixed on dev.
-
Thanks guys. Btw, this module was prompted by the need that Renobird mentioned for multiple field labels with the Page reference input labels.
-
Turns out that this was going to add more complexity than I was comfortable with for this field configuration. For instance, you've got an asmSelect and can select fields, but that only says what fields and order. It doesn't say what punctuation or other words you might want in there. For example, if I wanted to have my label composed of fields "first_name last_name" then I'd just want a space separating the two fields. But if I wanted it as "last_name, first_name" then I'd want a comma and a space separating the fields. Furthermore, lets say I wanted "last_name, first_name, Age: years_old". So it seems like more is needed than just the ability to select multiple fields. As a result, I made the FieldtypeConcat module instead, which takes care of all these needs and more. I had the subject of this thread in mind when creating the module, but there are plenty of other situations where this module may be worthwhile.
-
The problem there is that you've got a Process module that is 'autoload', and Process modules aren't meant to be autoload except in specific circumstances. I'd suggest extending WireData rather than Process. Another issue is that you don't want to add that script to every page like you are doing now. You only want to add it when it's needed. So you'd hook into something like ProcessPageEdit::execute instead. This would ensure that your JS is only loaded when it is needed. public function init() { $this->addHookAfter('ProcessPageEdit::execute', $this, 'addScript'); } public function addScript(HookEvent $event) { $this->config->scripts->add($this->config->urls->AdminJQuery . "adminjquery.js"); }
-
I'd probably go for the 27" iMac too. It would just make everything feel better as it's kind of like adding a work of art to the room. A 15" Macbook Pro with Retina screen might also be worth considering. I use a 2008 Mac Pro with 30-inch + 24-inch Dell screens. The main benefit of the Mac Pro is that it's extremely upgradable and lets you get another few years out of the system that you might not be able to get out of Apple's other offerings. But I wish Apple was continuing to update the MacPro line more consistently, as the one they are selling today (4 years later) is not that much different than the one I have. it's kind of hard to justify a Mac Pro now. But I think this system will keep me going for another 2-3 years. If Apple ever puts a retina screen in the iMac at a good price point (as I'm guessing they will), that would be ideal.
-
New things get added too. Once 2.3 is out, I'm going to try and go through everything and track down what new stuff should be added to the docs and cheatsheet. I think eq() has been there since the beginning, though it's admittedly one I don't use often (easy to forget it's there).
-
10 hours to go here in the US (Eastern). Happy new year everybody!
-
I'm not sure what it could be, as I've not seen that before. But I'm wondering if a PHP cache (APC, eAccelerator, etc.) might have been interfering here?
-
Not sure, but I'll check in to it next time I'm working with the files/images inputfields. It is relatively easy to do from the API though, as you can call $page->images->removeAll(); for example.
-
Something else good to say about ServInt is that they've been routinely upgrading the capabilities of their existing accounts over time, without asking for more money. In my case I have an Essential VPS account I bought with them years and years ago. The account doesn't stay at the specs you bought it at. If the capabilities of your plan gets upgraded for new/prospective customers, then it gets upgraded for you too. You don't even have to ask. It just happens and they let you know after the fact that "you now have an extra 10 gigs of space", for example. ServInt is good at keeping the customer happy in the long run. This is different from other hosts I've dealt with, and am currently dealing with. I've had a account with PowerVPS for as long as I've had one with ServInt. It's also been quite reliable, but it is configured identically to when I purchased it years ago. The ServInt one is now much more capable than the PowerVPS one, despite the fact that they started the same and cost the same. Now I am at the point where I'm looking to get rid of the PowerVPS one just because it's no longer competitive.
-
Sounds like something is not quite right with the MySQL you are running, whether it's version related or something missing from MySQL (fulltext index support?). I think the first error reveals everything that we need to know: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'\', PRIMARY KEY (`pages_id`), KEY `data_exact` (`data`), FULLTEXT KEY `' at line 2 If that is failing, then something isn't right with the MySQL server. Let us know what version, or you can PM me a link to a phpinfo file. If this is occurring at some specific webhost (rather than your own computer), let us know of that too.
-
Not a problem, I can update this soon. Has anyone tried this version of TinyMCE with PW yet? Just wondering if there's anything to watch out for, or if this is a fairly clean update.
-
GET param modal not preserved after adding new page
ryan replied to teppo's topic in API & Templates
No problem, I have added this and it should appear on the dev branch on the next commit. -
ProcessWire Concatenate Fieldtype Fieldtype that concatenates the values from one or more other fields at runtime. The value can contain additional formatting and/or words as needed, which you define in your Concat field settings. Example Problem: Your system has a first_name and last_name field, and you want to have a separate full_name field composed of first_name and last_name, without redundancy. Solution: You would create a new Concat field, click the details tab, and enter "first_name last_name" (the fields you want to concatenate) in the settings. Other Potential Uses Having a field that combines the value of two or more others, without the redundancy of separately stored data. Defining a custom “label field” for select boxes, like those used with the Page field. Defining a custom label for your Page List that includes your own formatting. Defining an alternate variation of a text field that uses a different text formatter. Considerations The value for this fieldtype is generated at runtime and thus no data is stored in the database. This is good because there is no duplication. However, it also means that you cannot directly query a Concat field from $pages->find(), for example. If you happen to change the name of a field being used in a Concat field, you will have to update the name in your Concat field settings as well. By design, Concat fields do not inherit the text formatters of the fields they concatenate. You define these separately with the Concat field. Because this is a runtime-generated field, there is no Inputfield associated with it. How to Install Install the module by placing FieldtypeConcat.module in /site/modules/. Check for new modules on the Modules screen in the ProcessWire admin. Click Install for the Concat Fieldtype. How to Create a Concat Field Under Setup and Fields create a new field using type Concat. After entering the new field name and label, click Save. Click the Details tab and enter one or more field names. Separate them with whatever spacing and punctuation is appropriate. Optionally choose one or more Text Formatters. If you are not sure which, “HTML Entity Encoder” is a good default to use. Save. Add your new field to one or more Templates. How to access the value of a Concat field This is no different than accessing the value of any other field. If your Concat field has the name “full_name” then you would output its value like this: echo $page->full_name; Download PW Modules Site: http://modules.proce...eldtype-concat/ GitHub: https://github.com/r...FieldtypeConcat
- 47 replies
-
- 21
-
-
Thanks for sharing this with us, looks good! Please post to the modules directory (under the site profiles category) when ready. As a small, though not really necessary optimization, that big switch statement might convert nicely to something simpler: $names = array(null, 'one', 'two', 'three', 'four', ...and so on); $column[$key] = $names[$value];
-
I agree those will also be useful down the road. Though from this side, those are a little harder to break, so the more immediate need is a test suite for selectors. This is also needed to maintain consistency between selectors that result in DB queries, vs. selectors that occur in-memory. Because they are handled by two totally different things, this is a common point of inconsistency. They aren't even 100% consistent right now, but I'd like to aim for it, and tests are necessary prerequisite for this. Thanks! I'm not particularly experienced in this area either. But I think our needs for a test suite are different than those of traditional TDD. We need something like what you and I were originally working with, but taken a lot further. It needs to be a site profile built for the needs of running these tests. It would contain a diverse range of pages and fields, and the template file(s) would perform the tests, looking or anything unexpected. One thought is that we might build it on top of the existing skyscrapers profile since that already contains a good number of pages and fields, along with intelligible test cases to work with.
-
Exceptions are catchable, not hookable. I could probably add a hook to manually trigger in PW's main exception handler. Though if a DB exception occurs at bootstrap time (which is when you'd likely see it, if it occurred), then any modules wouldn't yet be loaded. This would also introduce the potential of infinite loops, like if any of the hooked functions themselves triggered an exception. It would be more likely to occur in this case (the last resort exception handler) since an exception at this point is a fatal error and means something about the system isn't working.
-
How to automatically create a bunch of child pages when saving?
ryan replied to titanium's topic in Module/Plugin Development
Change this: foreach($titles as $title) { if($page->children('title=' . $title)->count() !== 0) break; ... } to this: $children = $page->children("include=all"); foreach($titles as $title) { if($children->has("title=" . wire('sanitizer')->selectorValue($title))) continue; ... } That "include=all" in the children call ensures that the children are included even if in the trash. It's also better to just do one $page->children() call here, because every time you pass in a unique selector to children(...) it executes another query. This way, it's only executing one query. The wire('sanitizer') call isn't technically necessary for the page title's you've given, but I put that there just in case your actual page titles might contain commas in them. But honestly it would be better to use the page "name" property rather than title, since it is limited to a small set of characters, guaranteed to be unique for the parent, and more appropriate for this type of thing. If you use $page->name, you could optimize it further by changing the first line to: $children = $page->children("name=" . implode('|', $names)); You could do this with title too, like Pete was mentioning. But it's a little harder to account for the page titles in OR selectors since there is such a broad set of characters allowed in titles. -
The tooltip() is something that's part of the most recent jQuery UI versions. We're using the latest jQuery/jQuery UI in 2.3. I don't think that there is a tooltip() in the version of jQuery UI used by PW 2.2.