Input format is changed to 0

dpopov - August 17, 2009 - 17:56
Project:Advertisement
Version:6.x-2.1
Component:ad module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

After ad is saved (when creating or editing) input format is changed to 0 in database (table node_revisions) and can be changed only by editing in database.

No such problem with other content types.

Advertisement 6.x-2.1
Drupal 6.13
PHP 5.2.10
MySQL 5.0.77
Apache/1.3.37 (Unix) PHP/5.2.10 mod_perl/1.30

#1

simpsonetti - August 19, 2009 - 07:33

I think i have the same probem.
image_ad is working fine, html_ad won't be shown. and "format" in database was 0. i changed it to 1, 2 and 3 but the ad won't be shown.
Which value do you have set ?

#2

grzegorz.bartman - August 19, 2009 - 11:49

I have the same probem.

#3

dpopov - August 19, 2009 - 13:56

i changed it to 1, 2 and 3 but the ad won't be shown.
Which value do you have set ?

Number 4 – it's my own input format with all filters removed. But in my case number 3 (PHP code) works too.

#4

tetramentis - August 24, 2009 - 11:50

Same problem here, using both Raw and javascript methods, using both block and embedded display. I'm trying to show this simple fragment:

<iframe src="http://www.ubuntu.com/files/countdown/904/countdown-9.04-1/countdown.html" width="180" height="150" frameborder="0" scrolling="no" name="ubuntucountdown"><a href="http://www.ubuntu.com/"><img src="http://www.ubuntu.com/files/countdown/904/countdown-9.04-1/00.png" alt="Ubuntu 9.04 - on desktops, netbooks, servers and in the cloud" width="180" height="150" border="0" /></a></iframe>

Inspecting resulting page HTML code:

<div id="ad-1631" class="html-advertisement"><p><a href="http://www.ubuntu.com/"/></p></div>

Clearly, original HTML is just filtered. When editing the ad, original source is in place.

Using the debug=2 GET parameter:

ad_dir: '(...)/sites/all/modules/ad'
debug: '2'
adcache: 'none'
nids: ''
tids: ''
hostid: ''
url: 'node/1626'
quantity: '1'
aid: '0'
ad_display: 'javascript'
--> Time mark: 14:46:11
Memory usage: 707.508 K
Drupal bootstrap '0'.
Drupal bootstrap complete.
Root drupal directory detected as '(...)'.

(...)/sites/all/modules/ad/serve.php: // $Id: serve.php,v 1.1.2.2.2.1.2.1 2009/02/23 22:39:02 jeremy Exp $
(...)/sites/all/modules/ad/adserve.inc: // $Id: adserve.inc,v 1.1.2.31.2.8.2.8 2009/05/07 13:52:13 jeremy Exp $
(...)/sites/all/modules/ad/adcache.inc:
(...)/sites/all/modules/ad/ad.module: // $Id: ad.module,v 1.2.2.29.2.83.2.16.2.26 2009/08/05 00:13:36 jeremy Exp $
(...)/sites/all/modules/ad/ad.install: // $Id: ad.install,v 1.2.2.4.2.27.2.7.2.4 2009/04/03 17:01:02 jeremy Exp $

adserve_cache function(get_ad_ids)
Cache function 'ad_cache_none_get_ad_ids' does not exist.
Memory usage: 723.000 K
Invoking cache function 'adserve_cache_get_ad_ids'.
Entering default adserve_display.
adserve_cache function(open)
Cache function 'ad_cache_none_open' does not exist.
Memory usage: 723.320 K
Invoking cache function 'adserve_cache_open'.
Drupal bootstrap '8'.
Drupal bootstrap complete.
Hostid: 'none'.
adserve_invoke_hook hook(init) action(first)
adserve_cache function(hook)
Cache function 'ad_cache_none_hook' does not exist.
Memory usage: 23,112.492 K
Invoking cache function 'adserve_cache_hook'.
adserve_cache function(get_cache)
Cache function 'ad_cache_none_get_cache' does not exist.
Memory usage: 23,112.930 K
Invoking cache function 'adserve_cache_get_cache'.
adserve_cache function(build_hooks)
Cache function 'ad_cache_none_build_hooks' does not exist.
Memory usage: 23,123.984 K
Invoking cache function 'adserve_cache_build_hooks'.
Did not find hook 'init'.
Function 'adserve_hook_init' does not exist.
adserve_cache function(id)
Cache function 'ad_cache_none_id' does not exist.
Memory usage: 23,128.094 K
Invoking cache function 'adserve_cache_id'.
Unsupported type 'host'.
Searching default: 0
adserve_cache function(id)
Memory usage: 23,128.094 K
Invoking cache function 'adserve_cache_id'.
Total ads: '2'.
Already displayed: 0
adserve_cache function(validate)
Cache function 'ad_cache_none_validate' does not exist.
Memory usage: 23,128.359 K
Invoking cache function 'adserve_cache_validate'.
Validated ads: '2'.
adserve_invoke_hook hook(filter) action(intersect)
adserve_cache function(hook)
Memory usage: 23,128.594 K
Invoking cache function 'adserve_cache_hook'.
Invoking hook 'filter'.
Including file: '(...)/sites/all/modules/ad/channel/ad_channel.inc'.
Invoking 'ad_channel_cache_filter'.
ad_channel_cache: adserve_cache_filter
adserve_cache function(get_cache)
Memory usage: 23,220.508 K
Invoking cache function 'adserve_cache_get_cache'.
ad_channel_cache: checking aid(1631)
ad_channel_cache: aid(1631) has no channel info, nochannel_display(0)
ad_channel_cache: non-channel aid(1631) is valid if no valid ads are assigned to current channel
ad_channel_cache: checking aid(1630)
ad_channel_cache: aid(1630) has no channel info, nochannel_display(0)
ad_channel_cache: non-channel aid(1630) is valid if no valid ads are assigned to current channel
ad_channel_cache: using ads with no channel info
adserve_cache function(get_cache)
Memory usage: 23,222.641 K
Invoking cache function 'adserve_cache_get_cache'.
ad_channel_cache: aid(1631) is not a premiere advertisement
ad_channel_cache: aid(1630) is not a premiere advertisement
ad_channel_cache: returning non-premiere advertisements from randomly selected channel 0
ad_channel_enforce_inventory_level: not needed for channel(0)
Filtered ads: '2'.
adserve_invoke_hook hook(weight) action(first)
adserve_cache function(hook)
Memory usage: 23,224.203 K
Invoking cache function 'adserve_cache_hook'.
Invoking hook 'weight'.
Including file: '(...)/sites/all/modules/ad/weight/probability/ad_weight_probability.inc'.
Invoking 'ad_weight_probability_cache_filter'.
adserve_cache function(get_cache)
Memory usage: 23,240.961 K
Invoking cache function 'adserve_cache_get_cache'.
ad_weight_probability cache_filter gcd(100)
ad_weight_probability cache_filter aid(1631) weight(2)
ad_weight_probability cache_filter aid(1630) weight(1)
Weighted ads: '3'.
adserve_invoke_hook hook(select) action(first)
adserve_cache function(hook)
Memory usage: 23,241.172 K
Invoking cache function 'adserve_cache_hook'.
Did not find hook 'select'.
Invoking 'adserve_hook_select'.
Randomly selecting ad 1 of 1.
Randomly selected ID: 1631.
adserve_cache function(validate)
Memory usage: 23,242.266 K
Invoking cache function 'adserve_cache_validate'.
Selected ads: '1'.
adserve_cache function(display)
Cache function 'ad_cache_none_display' does not exist.
Memory usage: 23,243.578 K
Invoking cache function 'adserve_cache_display'.
adserve_cache function(display_ad)
Cache function 'ad_cache_none_display_ad' does not exist.
Memory usage: 23,243.578 K
Invoking cache function 'adserve_cache_display_ad'.
Ad type 'html', loading module 'sites/all/modules/ad/html/ad_html.module'
ad: <div class="html-advertisement" id="ad-1631"><p><a href="http://www.ubuntu.com/"></a></p> </div>
adserve_cache function(increment)
Cache function 'ad_cache_none_increment' does not exist.
Memory usage: 33,498.852 K
Invoking cache function 'adserve_cache_increment'.
adserve_cache_increment action(view) aid(1631) hostid()
Drupal bootstrap '8'.
Drupal bootstrap complete.
adserve_invoke_hook hook(increment_extra) action(merge)
adserve_cache function(hook)
Memory usage: 33,498.852 K
Invoking cache function 'adserve_cache_hook'.
Did not find hook 'increment_extra'.
Function 'adserve_hook_increment_extra' does not exist.
adserve_cache_increment extra()
adserve_cache function(close)
Cache function 'ad_cache_none_close' does not exist.
Cache function 'adserve_cache_close' does not exist.
adserve_invoke_hook hook(init_text) action(append)
adserve_cache function(hook)
Memory usage: 33,500.148 K
Invoking cache function 'adserve_cache_hook'.
Did not find hook 'init_text'.
Function 'adserve_hook_init_text' does not exist.
adserve_invoke_hook hook(exit_text) action(append)
adserve_cache function(hook)
Memory usage: 33,500.148 K
Invoking cache function 'adserve_cache_hook'.
Did not find hook 'exit_text'.
Function 'adserve_hook_exit_text' does not exist.
Memory usage: 33,500.148 K
document.write('\x3cdiv class=\"html-advertisement\" id=\"ad-1631\"\x3e\x3cp\x3e\x3ca href=\"http://www.ubuntu.com/\"\x3e\x3c/a\x3e\x3c/p\x3e\n\x3c/div\x3e');

Note line ad: <div class="html-advertisement" id="ad-1631"><p><a href="http://www.ubuntu.com/"></a></p> </div>.

Could someone suggest how to fix this?

#5

javamandk - August 24, 2009 - 13:22

I have the same probem.

#6

simpsonetti - August 25, 2009 - 13:31

i chaged it now to 2 (manualy, fullhtml) and it is partial working:
one ad works, one not.
but the code i get from my partner is with comments ( ) and this will be filtered and shown above the ad.
Why ?

#7

simpsonetti - August 25, 2009 - 13:42

it is strange. Now i lokk to my ads and there were again at "filtered html" ??
i solved it like this: html i need was put into "filtered html" and this works.

#8

modulist - August 25, 2009 - 20:59

I was trying to create an ad with and tags in it. I had to add these to the list of tags accepted as filtered HTML. For a large community site with user-submitted content, that makes me really nervous.

there must be abetter way to have full HTML enabled for HTML ads.

#9

tetramentis - August 28, 2009 - 10:45

another workaround/hack is:
- locate function theme_ad_html_ad($ad) in ad/html/ad_html.module file
- replace this code

if (isset($ad->html) && isset($ad->format)) {
  $output .= check_markup($ad->html, $ad->format, FALSE);
}

with
if (isset($ad->html) && isset($ad->format)) {
  $ad->format = 2;
  $output .= check_markup($ad->html, $ad->format, FALSE);
}

This forces all ads of type 'HTML' to be treated as Full HTML.

One could also completely bypass markup checking by replacing the output line with a simple $output .= $ad->html;

#10

tetramentis - August 28, 2009 - 11:05

If someone wants to proceed with fixing this issue properly: ad edit form is in function ad_form(&$node, &$form_state) in file ad/ad.module (took me several minutes to find); actual processing takes place in function ad_nodeapi(&$node, $op, $teaser, $page).

#11

Jeremy - September 18, 2009 - 20:18
Status:active» fixed

It took me a disturbingly long time to track down this bug. Fix committed. (Essentially, if $form['body'] isn't set, then $form['filter'] is erased.)

#12

tetramentis - September 18, 2009 - 20:31

Thank you!

#13

System Message - October 2, 2009 - 20:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#14

reubidium - October 14, 2009 - 03:06
Priority:normal» critical
Status:closed» active

I'm sorry to say that this problem is still present. I'm using the 6.x-dev build as of 2009-Oct-08, and am experiencing the behavior that whenever an ad node is saved, the 'format' column is set to 0 in node_revisions, regardless of what is selected on the front end. Going into the db and manually changing this value, the change is lost and goes back to 0 if the node is edited.

#15

Jeremy - October 20, 2009 - 22:31
Priority:critical» normal

I am unable to duplicate. Can anyone else duplicate this?

#16

theunraveler - October 21, 2009 - 23:06

Subscribing.

#17

jaron - November 6, 2009 - 15:24

Subscribing. Having the same issue.

#18

Jeremy - November 23, 2009 - 22:44
Status:active» postponed (maintainer needs more info)

Please try 6.x-2.2-rc1, this bug should now be fixed:
http://drupal.org/node/640980

#19

Jeremy - November 24, 2009 - 20:05
Status:postponed (maintainer needs more info)» fixed

I retested with the latest release and am unable to duplicate. Marking as fixed.

#20

System Message - December 8, 2009 - 20:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.