Jump to content

HerTha

Members
  • Posts

    52
  • Joined

  • Last visited

Posts posted by HerTha

  1. Hi all,

    I am trying to copy some existing data stored in a repeater field "itemlist" to a ProFields table "itemtable" using this PHP snippet:
     

    <?php
    include("./index.php"); // bootstrap PW
    
    $page_name = "apage.html";
    
    $p = wire("pages")->get("name=$page_name");
    $p->of(false);
    
    if($p) {
    	foreach($p->itemlist as $item) {
    		$item->of(false);
    		if($item->il_code != '') {
    			echo "<p>Element " . $item->il_code . " : " . $item->il_desc . " belongs to page " . $page_name . "</p>";
    			$new_row = $p->itemtable->makeBlankItem();
    			$new_row->code = $item->il_code;
    			$new_row->desc = $item->il_desc;
    			$new_row->avail = $item->il_avail;
    			$p->itemtable->add($new_row);
    		}
    	}
        $p->save();
    }
    
    

    Basically that works well - problem is that all HTML tags get removed when storing the text fields in the table. I have checked to make sure that no textformatters are specified in columns settings of that table. Are there any additional sanitizers etc. I need to take care of when dealing with such table fields?

    TIA, HerTha

  2. @Ryan et al:

    Can't help writing a line to say thank you for this amazing project and forum and community!

    I've been lurking around here for a few weeks already, attempting to set up a project to migrate an existing static web site. I quickly figured out that PW was the way for me to go, because of it's technical features and concepts. What surprised me, though, was the fact that I was able to get answers on nearly every question that arised during that process "in an instant" - thanks to the excellent resources of this community and forum contributors devotedly offering a helping hand. That's simply impressive - I hope to continue to maintain a steep learning curve to be able to return a little bit of that at some time...

    • Like 6
×
×
  • Create New...