Welcome Guest, Not a member yet? Register   Sign In
Is this a cache problem?
#11

[eluser]CroNiX[/eluser]
Also, publish() is a method, not a property, so it should have the (), and I don't see you passing any variables to it.
#12

[eluser]scherman[/eluser]
[quote author="CroNiX" date="1328859215"]Also, publish() is a method, not a property, so it should have the (), and I don't see you passing any variables to it.[/quote]

It isn't a method, it is a property. The problem is my translate, i wanted to write: "$article->published".

Because i have all the object's name and field's name in spanish, and i translate before writting here so you can understand it well.
#13

[eluser]scherman[/eluser]
[quote author="CroNiX" date="1328859117"]Instead of redirecting from that function, why not just return TRUE/FALSE since that is what you are checking for here:
Code:
<?php if($article->publish): ?>
  //render published.png (the green button)
<?php else: ?>
  //render unpublished.png (the red button)
<?php endif ?>
[/quote]

I don't get it.

But to understand why i don't want to solve like this:

Another fail example is (the article's creation for example):

- The article's list is shown (articles/index)
- The user click "Add Article" (GO TO articles/create)
- The user fills the fields (articles/create)
- The user click "Create" (it reload articles/create)
- The success message is shown (articles/create)
- The user click "Back to the article's list" (GO TO articles/index)
- The new article DOESN'T APPEAR on the list
- The user press F5
- Now the article appears on the list

Did you see? I have the same problem with all the backend procedures!
#14

[eluser]mejlo[/eluser]
Maybe the problem is in database table, how you defined the 'publicado' col ?
#15

[eluser]scherman[/eluser]
[quote author="mejlo" date="1328861709"]Maybe the problem is in database table, how you defined the 'publicado' col ?[/quote]

No, it's not the problem. I've checked this and it works.
#16

[eluser]scherman[/eluser]
I don't know if it helps, but in my htaccess, i have this:
Quote:# BEGIN Compress text files
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers

# BEGIN Turn ETags Off
FileETag None
# END Turn ETags Off
#17

[eluser]WanWizard[/eluser]
If you don't debug, you don't know.

Get yourself firebug or a similar debug tool. Go through the sequence you descibed above, and check in firebug what is requested, and what is returned. If it is a cache issue, you should immediately see that, because the response would be a 304 (not modified) instead of a 200 (ok).

If, after the user pressed the button, the status of the 'published' flag is correct in the database, then DataMapper has done it's job, and the problem is elsewhere.




Theme © iAndrew 2016 - Forum software by © MyBB