Jump to content
Soma

HelperFieldLinks - field and template edit shortcuts

Recommended Posts

Ah yes the module inits on page edit screens.

I don't see any errors. DO you mean the array to string conversion notices martijn tells about?

The notices comes from the all the 'roles' arrays. I don't see them anywhere in the helper text (weird that they're bugging me). 

These are: editRoles, addRoles, createRoles & roles.

 

I changed the line 156 to this prevents the notices.

if(is_array($data_value)) $data_value = implode(" ", $data_value);
$settings_str .= "<h1>$data_key:</h1> $data_value<br/>";

I'm not seeing theses notices anywhere so wondering what PHP version you see them? For me it just output "Array" where there is a array in $data_value...

So that means my previous try to fix doesn't remove the notices?

Ah yes there still seems to be settings that are arrays. The editRoles etc are on template field not?
 
The fix you posted is simple but would just show the ids of the roles, and I would like to output title and links as with parent_id or template_id.
 
I will try to catch the roles also, hope that there's isn't much more. And leave a implode in there for those missing in case.

Share this post


Link to post
Share on other sites

Soma,

Yep, just getting the array to string notices. I am on php 5.5.4 although I expect 5.4.x would also give these errors.

Sorry in a rush at the airport, so can't debug right now.

Share this post


Link to post
Share on other sites

Oh and I gladly will accept any PR or help if anyone finds the time to implement those fixes. Currently short on bandwidth. :D



No and I don't have any notices on php 5.3.

  • Like 1

Share this post


Link to post
Share on other sites

Will see tonight if I have the time to debug.

I'm not very handy with that git stuff.

// start at line 160
if(in_array($data_key, array('editRoles', 'addRoles', 'createRoles', 'roles'))) {
	$array = $data_value;
	$data_value = '';
	foreach ($array as $id) $data_value .= $this->pages->get((int)$id)->name . ', ';
	$data_value = rtrim($data_value, ', ');
}

$settings_str .= "<span>$data_key:</span> $data_value<br/>";
Edited by Martijn Geerts
  • Like 2

Share this post


Link to post
Share on other sites

Hey Martijn,

Thanks for taking the time to help sort this out. I applied your fix and it works for page editing, but there were still notices if editing anything under the Admin page. I have to admit I haven't spent the time to fully understand the module and your fix, but I have added the following to line 97 and it seems to take care of the other notices:

if(in_array($data_key, array('required', 'textformatters', 'size', 'maxlength', 'description', 'collapsed', 'required', 'moduleTypes'))) {
    $array = $data_value;
    $data_value = '';
    if(is_array($array)) foreach ($array as $id) $data_value .= $this->pages->get((int)$id)->name . ', ';
    $data_value = rtrim($data_value, ', ');
}

$settings_str .= "<span>$data_key:</span> $data_value<br/>";
 

Not sure if there are any side effects.

  • Like 1

Share this post


Link to post
Share on other sites

I don't see any notices anymore here localy, maybe I just prevented it 'dirty' and didn't tell Soma anything :-)

So what I remember, is that $data_value is a string and sometimes an array. All those roles thingies are arrays, thats the reason I check for in_array.

Share this post


Link to post
Share on other sites

Hi, I just wanted to note that the php notice is still there, when using PHP 5.4 (not visible for PHP 5.3)

I am using the PHP dev version. Can this have to do with languages?

Share this post


Link to post
Share on other sites

Thanks for the reminder. I'll have a closer look again when I get bandwidth. 

Share this post


Link to post
Share on other sites

Thanks Soma for this module. It's one of the biggest admin improvements I've seen. This really saves me a lot of time!! Congrats.

Btw, it's not showing the field names in the users template, isn't it? even though I've added custom fields. It would be useful there too. Just letting you know!

Share this post


Link to post
Share on other sites

Sorry for the late reply, here is an example page:

Notice: Array to string conversion in /site/modules/HelperFieldLinks/HelperFieldLinks.module on line 155

Fields on that page used are of type: checkbox, select, range slider (from a module), text area, page, text, pagetitle...

Share this post


Link to post
Share on other sites

I am pretty sure on 2.3 I was seeing an error when editing the Home page, I have moved to 2.4 and now the only place I have seen this error is when editing the Admin page:

Notice: Array to string conversion in /Users/alan/.../example.ca/live/site/modules/HelperFieldLinks/HelperFieldLinks.module on line 96

Not a problem for me at all, I just hope it was helpful to report it here and I am not missing something silly.

Share this post


Link to post
Share on other sites

I am running the dev 2.4.7, it seems that the field links are not working at all. Can someone else confirm this? Thanks much :)

Share this post


Link to post
Share on other sites

I just updated an install to 2.4.7 and the field links are still working here.

Share this post


Link to post
Share on other sites

Hey Soma,

I still install this module on every site and was thinking that a nice addition would be to convert the "send_templates" pipe separated list of IDs to a comma separated list of template labels/names.

Anyway, just a thought for when you're bored :)

Share this post


Link to post
Share on other sites

Tried to install this on dev 3.0.2 and got error: Class 'Wiredata' not found (line 21 of /Library/WebServer/Documents/pw/site/modules/HelperFieldLinks/HelperFieldLinks.module). 

Edit: The problem seems to be: the line has "extends Wiredata" and should have "extends WireData".

By the way, could this link be added to the title where on hover the name of the field is now shown, but is not a link to edit it. Or at least the style:

.fieldEditLink, .templateEditLink {

margin-top: 1em; 

could be less that 1em, even without margin-top. 

Edited by lpa

Share this post


Link to post
Share on other sites

Very nice, just what the doctor ordered! Seem to work fine on 3.0.6.

Perhaps the UI could be polished more but otherwise it's a huge time saver.

  • Like 1

Share this post


Link to post
Share on other sites

For a while now I run into the before-mentioned "Array to string conversion" issue on editing a page:
 

Notice: Array to string conversion in ..../site/assets/cache/FileCompiler/site/modules/HelperFieldLinks/HelperFieldLinks.module on line 166

		else if(is_array($data_value)){
			$data_value = implode("|",$data_value);
		}
		$settings_str .= "<span>$data_key:</span> $data_value<br/>";

It occurred in PW 3.0.18 and now in PW 3.0.20, too.

Share this post


Link to post
Share on other sites
For a while now I run into the before-mentioned "Array to string conversion" issue on editing a page:

Yeah, there a several posts about this if you look back through this thread, as well as a Github Issue (https://github.com/somatonic/HelperFieldLinks/issues/6) - sounds like Soma has had trouble reproducing, so maybe one of us needs to help out and put together a PR that fixes them all - anyone keen?

Share this post


Link to post
Share on other sites

I have always liked this module, but now found out that using this together with AdminPageFieldEditLinks-module there is a problem with the links alignments. I don't know which one should be fixed, though. 

Normal view:

normal-view.png.9d566098e3d7bc9ca77c827412320541.png

Broken view:

broken-view.png.13183f3fc6648652286a41b59864c322.png

Share this post


Link to post
Share on other sites

Love this module, but unfortunately breaks on RepeaterMatrix fields. 🙁

image.png.4c8cd23fc6c627e8e052a5a5b5f16ff8.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      Process Cache Control
      This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Plans for improvements
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots


    • By Macrura
      PrevNextTabs Module
      Github: https://github.com/outflux3/PrevNextTabs
      Processwire helper modules for adding page navigation within the editor.
      Overview
      This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)
      Usage
      This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.
      Warnings
      If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.
      For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.
      http://modules.processwire.com/modules/prev-next-tabs/
    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.2.0
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - 
      There is a new Version in the pipe, that supports WebP too: 
       
      - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - 
       
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
×
×
  • Create New...