Jump to content

Phantom field


Pip
 Share

Recommended Posts

Hi all.

I think I am being punked.

I created a template called "batch" where I have "slotstotal" which is integer/text to store the value. Oddly, I have entered a value in on a page using the batch template via the PW admin. But when I do a print_r, I got this.

image.thumb.png.483241d520097d64fa883b38c3d14ebd.png

I thought the field is bugged so recreated it with a different field name. Now when I refresh the page, I still got the same screen. (I tried changing the page a bit and it does reflect but the print_r is still the same. 

😞

 

Link to comment
Share on other sites

3 hours ago, Pip said:

Hi all.

I think I am being punked.

I created a template called "batch" where I have "slotstotal" which is integer/text to store the value. Oddly, I have entered a value in on a page using the batch template via the PW admin. But when I do a print_r, I got this.

image.thumb.png.483241d520097d64fa883b38c3d14ebd.png

I thought the field is bugged so recreated it with a different field name. Now when I refresh the page, I still got the same screen. (I tried changing the page a bit and it does reflect but the print_r is still the same. 

😞

 

Could you do a search through your codebase to find if somewhere you might be assigning that property to the page (a typo)?? At east it happens to me sometimes that I swap a variable's words like that lol

Came for the title, stayed for the issue 🤣 Like, wow what's FieldtypePhantom

  • Haha 2
Link to comment
Share on other sites

@elabx bet it got you excited.

Don't think it's a typo. Especially if you do a print_r($batch);

	<?php
			// Check if today is in a batch
			$batches = $pages->find("template=batch, batchdatestart<=today, batchdateend>=today");
		
			foreach ( $batches as $batch):				
		
			print_r($batch);
		?>

And this is the output (now):

image.thumb.png.8590d75715f013f25eac267ab597a67b.png

Here's a screenshot of the template now (not touching it now I swear!!)

image.png.ec6f59118057a35e5ddf015326e21b95.png

 

 

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...