Jump to content

BillH

Members
  • Posts

    271
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by BillH

  1. I've implemented a straightforward site search, but among the correct results it is returning pages that don't exist with strange URLs. If, for instance, the search is for "quercus" (it's a site about trees), some valid results are returned, e.g.: [domain]/publications/general-articles/quercus-tungmaiensis/ But I also get pages that do not exist with URLs I can't explain, e.g.: [domain]/site/en/tree-info/tree-info/-404--i-quercus-tungmaiensis-i/ [domain]/site/en/tree-info/-407--i--quercus-rubra-i/ [domain]/site/en/tree-info/tree-info/-407--i-quercus-rubra-i/ Note that there are fields in the system that contain italicised versions of the page title (e.g. "<i>Quercus rubra</i>"), and the tags may have got into the page title and name before the data was cleaned up. At one level explains the "-i-" in the invalid URLs, but it doesn't get me much further! The search is based closely on that in the PW default site, and the relevant code is as follows: $q = $sanitizer->text($input->get->q); if($q) { // Set up the search term $input->whitelist('q', $q); $q = $sanitizer->selectorValue($q); // Build the selector $selector = "title|main_text|item_description~=$q, has_parent!=2, limit=50"; // Find the pages $matches = $pages->find($selector); if($matches->count) { // ... // Render the results // ... } } I may well be missing something obvious, but at the moment I'm completely puzzled. Anyone know what's happening?
  2. I thought it might be worth mentioning - given remarks above - that another three years on this feature is still getting new users This time, it's to fire off my own page-renaming module before the Custom Upload Names module makes updates when the page name changes. This has allowed the modules to work together really easily and, I suspect, saved quite a lot of hard work!
  3. Many thanks @Robin S. I was coming at this from a different direction, and it hadn't occurred to me that link abstraction was what I was trying to achieve, but certainly it is!
  4. Something has gone wrong with @Soma's post - it's appearing just as a loading spinner. I have just the same question as the OP, who describes the answer as "absolutely fantastic", so it'd be great to know what that answer was!
  5. I had the same thing, and it was a result of permissions not being set properly for the dashboard. On the Settings tab for your Dashboard page, the role (or roles) for your user should appear under "Who can access this page?". If it doesn't, I'm not totally sure which of the following steps fixed it for me, but something worked! First, make sure the "dashboard" permission is selected for the role (the permission should have been created by the module). And of course, check the role is assigned to the relevant users. Then go to the Modules page and click the Refresh button. Then if that doesn't work, you may need to go to the permissions for the Admin template and under Access change "manage view and edit access" to Yes. Then hit Refresh on the modules page again. By the way, a quick look inside the Dashboard module indicates it uses the technique Ryan suggests at https://processwire.com/talk/topic/276-creating-new-admin-page/, which may help with debugging.
×
×
  • Create New...